Hi,
I want to write automation rule to block a transition if fixversion contains "-UPDATE" in it.
is it possible?
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 Action (Notify User and Move Issue Back):
fixVersion
Save and Activate the Rule:
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"}}]}
Hi @Mikel Garcia Bartolome ,
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
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}}
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
Hi @bill , I could not find a correct validator which can do this. could you please guide me
To perform that type of validator on Fix Version, please investigate marketplace addons as the built-in validators will not support the field.
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
It looks like you're new here. Sign in or register to get started.