Example 2 - Logging work as another user
Using Power Actions™ and the power of SIL™, you can do a lot of things with your Jira. For example, you can log work on behalf of another user.
For this, you can configure a button with a single step:
The button will be always enabled and it's essentially a script asking for a confirmation that we want to log work for another user. If the answer to the confirmation question on the first screen is "yes", then the action will be enabled, otherwise the action will be disabled.
The button contains a confirmation question and on its action screen we save the selected value:
screen script:
use "poweraction"; setActionTitle("Are you sure?"); createRadioGroup("Sure?", {"yes", "no"}, "yes", false, true, "You are about to log work on behalf of another user. This may have certain consequences. Are you sure you want to do this?"); setExecuteButtonText("Submit");
action script:
use "poweraction"; string option = getSingleValue(argv, "Sure?"); setBlitzAttribute("option", option);
The condition script for the action would look like this:
use "poweraction";
number ENABLED = 1;
number DISABLED = 2;
number HIDDEN = 3;
string option = getBlitzAttribute("option");
return option == "yes" ? ENABLED : HIDDEN;
In the screen script we configure the fields that we need to log the work:
In the action script we retrieve the values from the screen and add the worklog:
That's it!
That's how the implementation looks like in the ticket: