How to enable/disable Major Incident and check if the field is enabled using Jira automation
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
On the Jira Issue view, an incident can be marked as a major incident, by enabling or disabling the Major Incident toggle. You can find the details in Mark an Incident as Major
This article helps use automation to perform the below actions
Check if the major Incident field is enabled or not.
To enable/disable the field based on the requirement.
Environment
Jira Service Management Cloud
Solution
Check if the major Incident field is enabled or not.
Since the Major Incident field is a locked field, it can't be verified using the Issue fields condition. You would need to use the Advanced compare condition to check if the field is enabled or not.
Steps to create the automation rule:
Create an automation rule with a trigger based on requirements.
Add the Condition: If/else block
click on Add conditions
Select Advanced compare condition with the following entries:
First value: {{issue.Major incident}}
Condition: equals
Second value: MAJOR_INCIDENT
Add the Action, based on the requirement.
To enable/disable the Major Incident field using the automation rule.
Since the Major Incident field is a locked field, it can't be set/unset using the dropdown in the Edit Field action. You would have to update additional field values using JSON objects.
Note
You would need to grab the customfield ID for the Major Incident field to implement this.
In the below example, customfield_10136 is the field ID.
Steps to create the automation rule:
Create an automation rule with a trigger based on requirements.
Add a condition: The example shown here uses an if-else condition, however, this can be changed according to the requirements
Select the Edit issue Action, navigate to More options, and add the code below
Save the rule once done.
1
2
3
4
5
{
"fields": {
"customfield_10136" : "MAJOR_INCIDENT"
}
}
1
2
3
4
5
{
"fields": {
"customfield_10136" : ""
}
}
Was this helpful?