You can now vote for scripts to help people know if they're useful or not. Login or create an account to vote!


Update Priority Based on Linked Issues - ITSM


Use this script as a post function to update the priority of an issue based on the type of linked issues.

Implement the post function before the Update Change History for an Issue and Store the Issue in the Database step of a workflow.

  • Navigate to Issues > Workflows using the Administration Cog in the top right corner.
  • Find the Software Simplified Workflow workflow and click Edit.
  • In the list of transitions, find the Backlog transition and choose Selected For Development.
  • Click the Post Functions tab.
  • Click the Add Post Function on the right.
  • From the list, choose Script Post-Function [ScriptRunner] and click Add.
  • Choose Custom Script Post-Function.
  • Configure the screen and add the script.
  • Click Update. The post function should now show up in the list.
  • Click Publish at the top to publish the workflow.
  • When it asks you to save a backup click No.


Detailed use case example: Using PostFunctions to Set Remedial Action Priority


  • Jira Jira (8.0 - 8.14)
  • ScriptRunner for Jira ScriptRunner for Jira (6.18.0)
import com.atlassian.jira.component.ComponentAccessor // the name of the priority to set final priorityName = 'Highest' def numberOfLinkedAlerts = ComponentAccessor.issueLinkManager .getOutwardLinks( .findAll { in ['Problem/Incident'] && == 'Alert' } .size() if ( == 'Remedial Action' && numberOfLinkedAlerts) { def availablePriorities = ComponentAccessor.constantsManager.priorities def highestPriority = availablePriorities.findByName(priorityName) assert highestPriority: "Could not find priority with name $priorityName. Available priorities are ${availablePriorities*.name}" issue.setPriority(highestPriority) }
Discovered an issue? Report it here

Suggested for you

Appears in these Collections