Versions Compared
Version | Old Version 6 | New Version Current |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Problem
Once in a while it happens that we You want to lock an issue , where by lock I mean and ensure that only the issue assignee of that issue can play with it. There's an open ticket about this with Atlassian, and Power Actions™ helps resolve it.This example shows you how to do that by using edit it.
Tip |
---|
Power Actions™ allows an assignee to lock an issue (with only logging work or commenting on the issue possible), without the need to Set Issue Security Level or have the Edit issue permission. |
Solution
To solve this problem, you can use Power Actions™ and the Issue Security Scheme.
Solution
The idea is to create Begin by creating two actions: Lock and Unlock that only the assignee of the issue will see and a security level (Locked) that will only allow the assignee to see the issue.
The Lock action will set sets the security level to Locked.
The Unlock action will set sets the security level back to none.
Info |
---|
The actions are only visible to the issue assignee. |
Create the security level
Now let's get working. First off, we must create Create the security level , which looks like thisas below:
Image RemovedImage AddedCreate the actions
Once we've done that, it's time to create the actions. We will create two actions Create the Lock and Unlock actions.
Image RemovedImage AddedFor the conditions, we will disable the Lock button if the security level is already Locked, and disable the Unlock button if the security level is empty. Of course, we will only show the buttons to the current assigneeClick Edit conditions. Enter the following scripts for each action.
Lock button condition script
Code Block |
---|
number ENABLED = 1; number DISABLED = 2; number HIDDEN = 3; if( assignee != currentUser()) { return HIDDEN; } if( securityLevel == "Locked" ){ return DISABLED; } return ENABLED; |
Unlock button condition script
Code Block |
---|
number ENABLED = 1; number DISABLED = 2; number HIDDEN = 3; if( assignee != currentUser()) { return HIDDEN; } if(isNull(securityLevel)) { return DISABLED; } return ENABLED; |
Info |
---|
The Lock button is disabled if the security level is already Locked. The Unlock button is disabled if the security level is Null. |
The buttons are only visible to the current assignee.
For the Lock button we will , set the issue security to Locked and for . For the Unlock button we will , set it to none.
Lock button script
Code Block |
---|
securityLevel = "Locked"; |
Unlock button script
Code Block |
---|
securityLevel = ""; |
Testing
That's it! Now let's test it.
Image RemovedImage Removed Instead of current assignee, we could Now you can test. Note
Info |
---|
You can set the value of |
the User picker custom field to Allowed user instead of Current assignee. Also, you can change the value of the custom field to |
Current user when locking an issue |
. This also resolves a common problem |
that users have encountered using Jira. |
Table of Contents
Table of Contents |
---|