Skip to content

Add job key to coded action app getTask method - #720

Open
Sandeepan-Ghosh-0312 wants to merge 1 commit into
mainfrom
feat/addJobKeyCodedActionApp
Open

Add job key to coded action app getTask method#720
Sandeepan-Ghosh-0312 wants to merge 1 commit into
mainfrom
feat/addJobKeyCodedActionApp

Conversation

@Sandeepan-Ghosh-0312

@Sandeepan-Ghosh-0312 Sandeepan-Ghosh-0312 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Surfaces jobKey — the GUID key of the job that created the task — on the Task object that getTask() resolves.

Type and documentation only. getTask() resolves Action Center's LOADAPP payload as-is, so the value already arrives on the message; this PR gives it a name on the public type so apps can read it without a cast.

Why

A coded action app that creates Orchestrator resources needs the job behind the task to hang them off. The case in hand is file upload: attachments.create() takes a jobKey, and the link it makes is what decides who can read the file back — an attachment that belongs to no job is readable only by the account that created it, so an approver opening the action would get a 403 on the file the reviewer just uploaded.

const task = await codedActionApps.getTask();

await attachments.create(file.name, file, {
  folderId: task.folderId,
  jobKey: task.jobKey,   // the link that makes the attachment readable by anyone else
});

What changed

File Change
src/types.ts jobKey added to the Task type
src/coded-action-app.models.ts field added to the getTask() JSDoc example — the source of both the docs site and IDE hovers
packages/coded-action-app/README.md getTask() field list and the Task type reference
docs/coded-action-app-sdk/getting-started.md getTask() field list on the docs site
packages/coded-action-app/package-lock.json drops stale libc arrays from optional rollup platform entries — an artifact of the npm version that regenerated the lock, no dependency or version change

No behaviour change: no new events, no change to the existing ones, and nothing to migrate. Reading task.jobKey is opt-in.

Release

The version bump is not in this PR — per the release workflow it ships on its own, so jobKey reaches consumers with the next publish of @uipath/coded-action-app.

@Sandeepan-Ghosh-0312
Sandeepan-Ghosh-0312 requested a review from a team September 7, 2026 11:34
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://UiPath.github.io/uipath-typescript/pr-preview/pr-720/

Built to branch gh-pages at 2026-09-08 05:55 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Comment thread packages/coded-action-app/src/types.ts Outdated
Comment thread packages/coded-action-app/package.json Outdated
@claude

claude Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Two issues found this run — details in the inline comments.

Comment thread packages/coded-action-app/README.md
@claude

claude Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

One new finding this run:

  • README.md line 129 — Syntax error in the TypeScript type reference block: jobKey: string; | null; has a premature semicolon making it invalid TypeScript. Should be jobKey: string | null; (or jobKey: string; if null isn't possible — but note this is inconsistent with src/types.ts which currently declares jobKey: string without null). Details in inline comment.

Comment thread packages/coded-action-app/README.md Outdated
@claude

claude Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

One new finding this run:

  • README.md:128 — Syntax error in the Task type documentation block: jobKey: string; | null; has a stray semicolon, and the | null contradicts src/types.ts which declares jobKey: string (non-nullable). Details in the inline comment.

@Sandeepan-Ghosh-0312 Sandeepan-Ghosh-0312 changed the title Feat/add job key coded action app Add job key to coded action app getTask method Sep 7, 2026
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Sandeepan-Ghosh-0312
Sandeepan-Ghosh-0312 force-pushed the feat/addJobKeyCodedActionApp branch from dfe8b59 to 03224f9 Compare September 8, 2026 05:54
@claude

claude Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@Sandeepan-Ghosh-0312

Copy link
Copy Markdown
Contributor Author

Will merge this once the Action Center changes have reached prod al rings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants