Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Warning

Looking for the documentation on the newest versions of Power Actions for Jira 8? Click here and leave these dusty old pages behind!

Using Power Actions and the power of SIL, you can do a lot of things with your JIRAJira. For example, you can log work on behalf of another user.

For this, I configured you can configure a button with a single step:

Image RemovedImage Added

The button will be always enabled and it's essentially a script simply asks asking for the a confirmation that we want to log work for another user. The action will be enabled if we answer with "yes" If the answer to the confirmation question from on the first screen and disabled otherwise.So the button only is "yes", then the action will be enabled, otherwise the action will be disabled.

The button contains a confirmation question and on it's its action screen we only save the selected value:

  • the screen script:

    Code Block
    BA_setActionTitle("Are you sure?");
    BA_createRadioGroup("Sure?", {"yes", "no"}, "yes", false, true, "You are about to log work on behalf of another user. This may have somecertain consequences. Are you sure you want to do this?");
    BA_setExecuteButtonText("Submit");
  • the action script:

    Code Block
    string option = BA_getSingleValue(argv, "Sure?");
    BA_setBlitzAttribute("option", option);

The

...

condition script for the action would look like this:

Code Block
number ENABLED = 1;
number DISABLED = 2;
number HIDDEN = 3;

string option = BA_getBlitzAttribute("option");
return option == "yes" ? ENABLED : HIDDEN;

...


In the screen script we configure the fields that we need

...

to log the work:

Code Block
BA_setActionTitle("Log work as user");

BA_createUserPicker("User", currentUser(), false, true, "");
BA_createInput("Time Spent", "", false, true, "(eg 3w 4d 12h)");
BA_createDateTimePicker("Date Started", currentDate(), false, false, "");
BA_createRadioGroup("Remaining Estimate", {"Adjust automatically", "Use existing estimate"},"Adjust automatically", false);
BA_createTextArea("Work Description", "", false);

BA_setExecuteButtonText("Done");

...


In the action script we retrieve the values from the screen and add the worklog:

Code Block
string user = BA_getSingleValue(argv, "User");
interval timeSpent = BA_getSingleValue(argv, "Time Spent");
date startDate = BA_getDateValue(argv, "Date Started");
string estimate = BA_getSingleValue(argv, "Remaining Estimate");
string comment = BA_getSingleValue(argv, "Work Description");

if (estimate == "Adjust automatically") {
    addWorklogAdjustEstimate(key, user, timeSpent, startDate, comment);
} else {
    addWorklogExistingEstimate(key, user, timeSpent, startDate, comment);
}

That's it!

That's how the implementation looks like in the issueticket:

Image Removed                                          Image RemovedImage Added 

Image Added


See also

Example 1 - Choose your assignee