-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathassignForReview.js
More file actions
33 lines (28 loc) · 1.05 KB
/
Copy pathassignForReview.js
File metadata and controls
33 lines (28 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* Simple Assign For Review Action
* Assigns ticket to initiator and moves to "In Review" status
*/
// Import common Jira helper functions
const { assignForReview } = require('./common/jiraHelpers.js');
const tokenUsageComment = require('./js/common/tokenUsageComment.js');
function action(params) {
try {
const ticketKey = params.ticket.key;
const initiatorId = params.initiator;
// Post token usage summary comments (e.g. [story_acceptance_criteria]: {...}) if any provider
// wrote outputs/*_usage.json during the agent run.
try {
tokenUsageComment.postTokenUsageComments(ticketKey, { initiator: params.initiator });
} catch (e) {
console.warn('Failed to post token usage comments:', e);
}
// Use common assignForReview function
return assignForReview(ticketKey, initiatorId);
} catch (error) {
console.error("❌ Error:", error);
return {
success: false,
error: error.toString()
};
}
}