Versions Compared

Key

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

Table of Contents



Info
titleRequired apps
You will need the following Jira apps:
  1. Power Scripts for Jira
  2. Power Actions for Jira

Level: INTERMEDIATE

Problem

 The The problem of this recipe appears when two or more different users try to edit the same issue page. The mechanism explained bellow try to avoid this problem by locking the issue during the edit process and unlocking it at the end of the editing.

...

 To solve this problem we propose offer a solution that use two of our pluginsapps: Power Scripts for Jira and Power Actions Power Actions for Jira.

The Solution is exemplified on a Jira 5.2.1 environment. In order to resolve it you have to have administrator rights.

Step 1

Create a new Blitz-Action Power Actions custom field:

  • Go to Administration >> Issues >>  -> Issues -> Custom Fields and press click the link
  • Click the "Add Custom Field" button button
  • Select the Power Actions Custom Field and click next Next
  • Name it "Disable" and set the desired project you want to lock during the edit process, as shown in the picture:

...

  • Configure the "Disable" Custom Field by choosing the cog icon Image Removed and Image Added and selecting the "Configure" option.
  • Add two new buttons by clicking on the "Edit Buttons" link. Name those two buttons: "Lock" and "Unlock":

...

Create a new Custom Field that keeps the username of the user that locked the issue editing.

  • Go back to Administration >> Issues >>  -> Issues -> Custom Fields and press the link
  • Click the "Add Custom Field" button on the right top of the screen
  • Select the Text Field (< 255 characters) option and click next 
  • Name it "Is Locked" and configure it on the desired projects:

...

  • Type the following code:

    Code Block
    customfield_10304 = currentUser();
    
    return;

    Where "customfield_10304" is the ID of your "Is Locked" Custom Field. For doing this you have to:

      • Enter Administration section of
    • JIRA
      • Jira
      • Go to Issues Tab >> Custom Fields
      • View Field Configurations
      • Hover the mouse over "Edit" link 
      • URL preview at bottom of browser will include fieldID=....
      • The number that is shown is the number you are looking for
  • Go back and press the Edit Screen Script in on the Unlock button. Add the following code:

...