Versions Compared

Key

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

...

This validator can be used to perform a validation with a Jira expression. Based on the result of the expression, the user is either allowed or blocked to transition to the destination status.

Sample use cases:

(lightbulb) Force users to provide Fix Version/s only when the resolution is Fixed

...

titleClick here for the steps to configure

...

Add the Build-your-own (scripted) validator to the Resolve transition.

Write the following script in Jira expression field

...

(lightbulb) Prevent the

...

employee from

...

applying for a

...

leave if the

...

employee is in the 3 month probation period

Expand
titleClick here for the steps to configure
  • Add the Build-your-own (scripted) validator to the Create  Apply leave transition.

    • Write the following script in Jira expression field

      Code Block
      !! issue.customfield_1020212116 && new CalendarDate(issue.customfield_1020212116).plusMonths(3) > 0new Date().toCalendarDate()
    • Configure the error message: Inventory out of stock, where xxxxx is the id of the custom field holding the count of the stock

...

    • Cannot apply for a leave

(lightbulb) Force users to select both the parent and child values for a cascading select field

Expand
titleClick here for the steps to configure
  • Add the Build-your-own (scripted) validator to the Apply leave  transition.

    • Write the following script in Jira expression field

      Code Block
      !! issue.dueDatecustomfield_10400 && !!issue.dueDate.plusMonths(3) > new Date().toCalendarDate()customfield_10400.value && !!issue.customfield_10400.child
    • Note customfield_xxxxx is the id of the Cascading select field

    • Configure the error message: Cannot apply for a leave Input values for both the child and parent of the cascading field

Field required Validator

This validator can be used to conditionally perform a validation to ensure that the specified field has a value during a transition.

Sample use cases:

(lightbulb)

...

Force users to provide Fix Version/s only when

...

the

...

resolution is Fixed

Expand
titleClick here for the steps to configure
  • Add the Field required validator required validator to the Resolve transition.

  • Select the Fix Version/s fieldInput the following script in Validator scope section

    Code Block
    issue.resolution.name != "Fixed"

(lightbulb) Prevent the user from progressing on the Bug it is not assigned

...

Expand
titleClick here for the steps to configure
  • Add the Linked Issue validator to the Create transition.

  • Select the issue link type is Subtask of from the Issue Link Type field.

  • Select the issue type Story from the Issue Type field.

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

  • Input the Jira expression:

    Code Block
    !!issue.parent && issue.parent.subtasks.length < 65
  • Add the error message, "You cannot create more than 5 subtasks"

...

Expand
titleClick here for the steps to configure
  • Add the Linked issues status validator to the Close Closed transition.

  • Select the issue link type is Epic of from the Issue Link Type field.

  • Select the statuses the linked issues must be in, “Closed” status from Statuses

  • Add the error message, "The Stories of the Epic are not yet resolved"

...