Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Problem
Let's say that we You want the Project Lead to be able to easily project lead to reschedule issues in one simple step , setting the Fix Versions, Assignee which includes entering the fix versions, an assignee and an optional comment.
Solution
Create the action
First off, we create Begin by creating the Reschedule action.
Image RemovedImage AddedCondition
Scriptscript
Then, we must make it Next, enter the following code to set the action as available only for the project lead and applicable only for to issues that are not Resolved or Closed, so we write the following condition:.
Condition
Scriptscript
Code Block |
---|
number ENABLED = 1; number DISABLED = 2; number HIDDEN = 3; if(projectPM(project) == currentUser() && status != "Resolved" && status != "Closed"){ return ENABLED; } return HIDDEN; |
Screen
Scriptscript
Next, we write the Screen Script. We must ask the user what Fix Versions to set, enter the below script to prompt the user to select fix versions and a new assignee (we will provide the old assignee as a default value is the initial assignee), and enter a comment field.
Screen
Scriptscript
Code Block |
---|
string TEXT = "TEXT"; string TEXT_DISABLED = "TEXT_DISABLED"; string [] fields; // fix versions fields = addElement(fields, "Fix Versions"); fields = addElement(fields, TEXT); fields = addElement(fields, ""); // assignee fields = addElement(fields, "Assignee"); fields = addElement(fields, TEXT); fields = addElement(fields, assignee); // comment fields = addElement(fields, "Comment"); fields = addElement(fields, TEXT); fields = addElement(fields, ""); return fields; |
This will generate code renders the following screen.
Image RemovedImage AddedTip |
---|
Type conversionDon't forget that assigning Assigning a string value containing that contains pipes to a string array , will split splits the original string at the position of each pipe. ThereforeThus, we you can use "1.0|2.0" as a value for Fix Versions to set multiple values. |
Action
Scriptscript
Finally, Enter the following Action Scriptscript.
Action
Scriptscript
Code Block |
---|
string [] fvers = getElement(argv, 1); string newAssignee = getElement(argv, 3); string comment = getElement(argv, 5); fixVersions = fvers; assignee = newAssignee; if(isNotNull(comment)){ addComment(key, currentUser(), comment); } |
Table of Contents
Table of Contents |
---|