Skip to end of banner
Go to start of banner

Lock issues

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Problem

You can use Power Actions™ and the Issue Security Scheme to lock an issue and ensure that only the issue assignee can edit it.

Power Actions™ offers the possibility of an assignee locking an issue without needing to grant them Set Issue Security Level or Edit issue permission (only logging work or commenting on the issue).

Solution

To lock an issue, you must first create two actions: Lock and Unlock. The actions are only visible to the issue assignee.

  • The Lock action sets the security level to Locked.

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

Create the security level

Create the security level:

Create the actions

Create the Lock and Unlock actions.

Click Edit conditions. Enter the below scripts for each action.
The Lock button is disabled if the security level is already Locked. The Unlock button is disabled if the security level is blank.

The buttons are only visible to the current assignee.

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;

Now create the action scripts.

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
 securityLevel = "";

Testing

Now you can test.

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


  • No labels