Hi,
I want to write automation rule to block a transition if fixversion contains "-UPDATE" in it.
is it possible?
Hi @Yugandhar Kumar Chintamaneni
I am not sure if it can be done with out-of-the-box validators, but for sure, it is possible with Jira expression-based validator. Expression you need is as follows:
!issue.fixVersions.some(version => version.name.includes('-UPDATE'))
There are several options available on the Atlassian marketplace.
I am from Forgappify, and we developed Jira Expression Validator, which is part of the Workflow Building Blocks for Jira app.
I would appreciate it if you could give it a try.
Cheers
Hi @Yugandhar Kumar Chintamaneni -- Welcome to the Atlassian Community!
Automation rules trigger after an event has occurred, such as an issue transition. They cannot block or prevent the event.
Instead investigate using workflow validators, perhaps from an addon, to prevent the transition.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To perform that type of validator on Fix Version, please investigate marketplace addons as the built-in validators will not support the field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Navigate to Automation Rules:
Create a New Rule:
Add Trigger:
Add Condition:
{{issue.fixVersions.name}}
contains
-UPDATE
Add Action:
Complete the Rule:
Here is an example of how you might configure the rule in detail:
Create a new rule:
Add Trigger:
Add Condition:
{{issue.fixVersions.name}}
contains
-UPDATE
Add Action (Notify User and Move Issue Back):
fixVersion
contains "-UPDATE".Save and Activate the Rule:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here's an example of how the rule might look in JSON format if you export it from Jira (you can format JSON here):
{
"name": "Block Transition for -UPDATE in fixVersion",
"trigger": {
"type": "issueTransitioned",
"config": {
"statusFrom": ["Any Status"],
"statusTo": ["Any Status"]
}
},
"conditions": [
{
"type": "advancedCompareCondition",
"config": {
"firstValue": "{{issue.fixVersions.name}}",
"compareType": "contains",
"secondValue": "-UPDATE"
}
}
],
"actions": [
{
"type": "sendEmail",
"config": {
"to": "assignee",
"subject": "Transition Blocked",
"body": "The transition was blocked because the fixVersion contains \"-UPDATE\"."
}
},
{
"type": "transitionIssue",
"config": {
"status": "Previous Status"
}
}
]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply.
Comparison worked and I am able to add a comment.
But issue is that it is transitioned to the next state. I want to block it and keep it in the previous status only.
in the below example it should be in Test in progress. But it is in workdone after i run this rule
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In Jira Automation, there isn't a direct way to "block" a transition during the event itself, but you can simulate this by immediately transitioning the issue back to its previous status if it contains "-UPDATE" in the fixVersion
. Here is how you can set up the rule:
Add Action to Transition Back:
{{fieldChange.fromString}}
to transition it back to its previous status.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.