Versions Compared

Key

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

This section has use cases that help you understand the usage of the Conditions provided by JMWE.

...

Expand
  • Add the Build-your-own (scripted) condition to the transition you wish to hide

  • Write this content in the Jira expression.

    Code Block
    !! issue.customfield_10002 && issue.customfield_10002.some(it => it == user)

    Replace the custom field id with the id of the Approvers field in your instance

(lightbulb) Block a specific transition when the Time to resolution is breached.

...

Expand
  • Add the Build-your-own (scripted) validator to the Start Progress transition.

  • Name the validator as “Check attachments”

  • Write the following script in Jira expression field

    Code Block
    issue.attachments.filter(attachment => attachment.mimeType == 'application/pdf').length > 0

(lightbulb) Show transition “Reject” only for users of the “Management” project role and “jira-administrators” group

...

Expand
  • Add the Build-your-own (scripted) validator to the Reject transition.

  • Name the validator as “Current user Project Role and Group”

  • Write the following script in Jira expression field

    Code Block
    user.getProjectRoles(issue.project).some(pr => pr.name == "Management") &&|| user.groups.includes("jira-administrators")

...

This condition can be used to hide/show a particular transition from the list of available workflow actions, based on the current status of the issue. 

Sample use cases:

(lightbulb) Disable a global transition from certain statuses

Expand
  • Add the Current status condition to the transition.

  • Select the statuses from which the Global transition should be disabled from enabled from the Current Status field.

(lightbulb) Block issue transition from current status to itself

Expand
  • Add the Current status condition to all the transitions of the workflow, the issue follows.

  • On each condition select all the status(es) from the Current Status field except the current one

(lightbulb) Allow users to transition the issue to Approve status only when the issue is in Verified status

Expand
  • Add the Current status condition to the transition "Approve".

  • Select "Verified" status from the "Current status" fielddestination status of the current transition

(lightbulb) Block transition to 'On Hold' status when the issue is in 'Closed' status

...

This condition can be used to hide/show a particular transition from the list of available transitions, based on the issue's linked issues. 

Sample use cases:

(lightbulb) Hide the transition "Triage" until at least one assigned subtask is available for the issue

Expand
  • Add the Linked Issue condition to the "Triage" transition.

  • Select the issue link type is Parent Of from the Issue Link Type field.

  • Select the issue type as Sub-task

  • Select the option "At least one linked issue must satisfy the condition below"

  • Input the Jira expression:

    Code Block
    linkedIssue.assignee !=null

(lightbulb) Hide the "Start Progress" transition on a ticket when there is

...

an issue linked to it through the “is blocked by” link type

Expand
  • Add the Linked Issue condition to the "Start Progress" transition.

  • Select the issue link type is blocked by from the Issue Link Type field.

  • Select the option "Every linked issue must satisfy the condition below"

  • Input the Jira expression:

    Code Block
    truefalse

(lightbulb) For a parent of issue type “Story” hide the In Progress transition until all its subtasks are in “In Progress”

Expand
  • Add the Linked Issue condition to the "Start Progress" transition of the workflow.

  • Select the issue link type is Parent Of from the Issue Link Type field.

  • Select the option "Every linked issue must satisfy the condition below"

  • Input the Jira expression:

    Code Block
    issue.issueType.name !== "Story" &&|| linkedIssue.status.name == "In Progress"

...

This condition can be used to hide/show a particular transition from the list of available transitions, based on the status of the issue's linked issues. 

Sample use cases:

(lightbulb) Hide the "Close" transition of the Epic until all its Stories are closed.

...