Lock issues

Problem

You want to lock an issue and ensure that only the issue assignee can edit it.

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.

Begin by creating two actions: Lock and Unlock.

  • The Lock action sets the security level to Locked.

  • The Unlock action sets the security level back to none.

The actions are only visible to the issue assignee.

Create the security level

Create the security level as below:

Create the actions

Create the Lock and Unlock actions.

Click Edit conditions. Enter the following scripts for each action.

Lock button condition script
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
number ENABLED = 1; number DISABLED = 2; number HIDDEN = 3; if( assignee != currentUser()) { return HIDDEN; } if(isNull(securityLevel)) { return DISABLED; } return ENABLED;

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, set the issue security to Locked. For the Unlock button, set it to none.

Lock button script
securityLevel = "Locked";
Unlock button script

Testing

Now you can test.