How to filter transitions based on issue type workflow in Jira Cloud

    Warning: Despite our best efforts, code can change without notice due to a variety of factors. If you encounter an issue in any of the code shown here and find that a specific block of code is not correct, or is causing errors, please check with the Community to find an updated version.

    In some cases, you need the workflow transitions to be different, depending on the issue type.  This article shows how you can filter transitions based on the Issue Type's workflow.

    Use case

    The support engineer creates an issue on the Service Desk JIRA then it is synced to the Development Jira. Once the developer resolves the issue, it triggers a "resolving" transition. The transition trigger should be specific for different issue types.  

    Script example

    It is possible to trigger a transition on a specific issue type with the help of the getIssueType and the transition method of the workflowHelper.

    Note: The script includes some custom issue type names. Replace existing issue type names with the relevant ones.

    Add the script to the Incoming sync rules:

    1 if (replica.resolution != null ) {
    2   if (issue.type == nodeHelper.getIssueType("Incident"))
    3 {     workflowHelper.transition(issue, "Resolve")   }  
    4   else if (issue.type == nodeHelper.getIssueType(        "
    5           Service Request") || issue.type == nodeHelper.getIssueType("Custom Issue Type")        
    6.          )
    7 {     workflowHelper.transition(issue, "Resolve this issue")   }}