Automation for linked bugs' severity

Neta Knyazhansky Caspy
Contributor
November 22, 2023

Hello,

I'm trying to create an automation for linked bugs' severity.

If the linked issue type is "Blocking/Is Blocked By", check the severity of both bugs. If the severity of the blocking bug is lower than the severity of the blocked bug, match the severity of the blocking bug to the severity of the blocked bug.

The use case is that we have critical bugs which are blocked by, let's say, medium bugs, but if a critical bugs is blocked, then the blocking bug should be critical as well.

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 22, 2023

Hi @Neta Knyazhansky Caspy 

A few questions...

  • What field type is Severity?
  • If a select list (or similar), how many options are there for Severity? If you could list the options also, that'd be great.

Ste

Neta Knyazhansky Caspy
Contributor
November 22, 2023

Hi @Ste Wright ,

The severity field is a single select drop down list with 6 options: Blocker, Critical, High, Medium, Low & Open.

Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 22, 2023

Hi @Neta Knyazhansky Caspy 

You could use IF/ELSE rules for this, but it's going to be a signifiant number as you'd need to compare every possible combination of Severity across source/destination.

I've found an alternative using the Custom Field's Option ID - it visualises the ID as a number, then uses advanced compare conditions to check if the ID is higher/lower on the source or destination issue, and sets the Severity accordingly.

---

Prerequisites

The rule will compare the Option IDs to decide which issue to edit. You need to find out if Blocker's Option ID is higher or lower than Open - eg.

  • If Blocker's ID is 10123 and Open 10129, then Open is higher
  • If Blocker's ID is 10456 and Open is 10449, then Blocker is higher

To confirm this information:

  • Go to Settings (cog icon in top-right) > Issues
  • Select Custom Fields from the left-hand menu
  • Search/locate the Severity field
  • On the right-hand side, select the breadcrumbs (...) > Contexts and default value
  • Select Edit Options
  • Hover over the Edit hyperlink in the Actions column for Blocker and Open individually, and note their Option IDs
    • This is the last value in the URL, eg. &selectedValue=10580

For the rule below, I've assumed Blocker is a lower ID number than Open

---

The Rule

  • Trigger: Issue Linked
    • Link Type = blocks
  • Action: Create Variable
    • Name = sourceSeverity
    • {{issue.Severity.id}}
  • Action: Create Variable
    • Name = sourceNumber
    • {{sourceSeverity.asNumber}}
  • Action: Create Variable
    • Name = destSeverity
    • {{destinationissue.Severity.id}}
  • Action: Create Variable
    • Name = destNumber
    • {{destSeverity.asNumber}}
  • Condition: IF Block
    • (1) IF...
      • All Conditions Match
        • Condition: Advanced Compare Condition
          • First Value = {{sourceNumber}}
          • Condition = equals
          • Second Value = <leave empty>
        • Condition: Advanced Compare Condition
          • First Value = {{destNumber}}
          • Condition = does not equal
          • Second Value = <leave empty>
      • Action: Edit Issue
        • Field = Severity
          • Value = COPY FROM - Destination Issue
    • (2) ELSE-IF...
      • All Conditions Match
        • Condition: Advanced Compare Condition
          • First Value = {{sourceNumber}}
          • Condition = does not equal
          • Second Value = <leave empty>
        • Condition: Advanced Compare Condition
          • First Value = {{destNumber}}
          • Condition = equals
          • Second Value = <leave empty>
      • Branch: Related Issues
        • Type = Destination Issue
          • Branch-Action: Edit Issue
            • Field = Severity
              • Value = COPY FROM - Trigger Issue
    • (3) ELSE-IF...
      • Condition: Advanced Compare Condition
        • First Value = {{sourceNumber}}
        • Condition = is greater than
        • Second Value = {{destNumber}}
      • Action: Edit Issue
        • Field = Severity
          • Value = COPY FROM - Destination Issue
    • (4) ELSE-IF...
      • Condition: Advanced Compare Condition
        • First Value = {{sourceNumber}}
        • Condition = is less than
        • Second Value = {{destNumber}}
      • Branch: Related Issues
        • Type = Destination Issue
          • Branch-Action: Edit Issue
            • Field = Severity
              • Value = COPY FROM - Trigger Issue

---

How it works:

  • The rule requires the Option IDs as a number, so it can compare if Blocker is a lower ID than Open (in this example) - and take action accordingly
  • The Create Variable actions work in two parts
    • The first variable identifies the ID, eg. 10580
    • The second variable turns that ID into a number
  • Once both the source and destination IDs have been stored as numbers, the 4 IF/ELSE conditions decide what to do next:
    • (1) and (2) check if one of the source/destination issues have no set Severity, whilst the other does - if these pass, it copies the Severity from the populated issue to the empty one
    • If both issues are populated, (3) and (4) then check if the numeric ID is higher or lower across source/destination, and takes action accordingly
  • If on your instance Blocker's ID is greater than Open's, you would just switch around the greater than / lower than conditions to allow the rule to work

---

Quite a bit of complexity here; I'd suggest testing it out, and letting us know if it works for you :)

Ste

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2023

Hi @Neta Knyazhansky Caspy 

I have a couple of questions to help clarify your scenario and possible solutions.  How would you answer these:

  • Will there only be 2 issues involved in this scenario or can there be a chain of issues?  For example:
    • Issue ABC-123 blocks < Issue ABC-456 blocks < Issue ABC-789 < ...
  • A defect (i.e., Jira bug) usually has a severity based upon defined criteria, such as scale, impact, availability of a work-around, etc.  You describe a need to change the severity based on blocking issues to help solve one problem.  For later analysis do you need to retain the original / actual severity of a defect?

Kind regards,
Bill

Neta Knyazhansky Caspy
Contributor
November 22, 2023

@Ste Wright WOW! Thank you so much for such a detailed answer.

I got stuck at verifying the Option ID, I hover over the options and nothing comes up. 
Any ideas?

Also, I wanted to verify the solution. If the destination (blocking bug) is lower then the source (blocked bug), then I'd like the destination to match the source.
If not, I'd like for them both to stay the same.
Is that the way you wrote the solution?

Neta Knyazhansky Caspy
Contributor
November 22, 2023

@Bill Sheboy I'll keep it simple for now, no chain of issues, only 2 issues linked to one another. Also, there's no need to retain the original severity.

Like Bill Sheboy likes this
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 22, 2023

Hi @Neta Knyazhansky Caspy 

You need to hover over the Edit hyperlink alongside each option, which is in the Actions column. I've edited my previous response to clarify this!

I'm also assuming this is a shared global custom field - if it's a Team-managed field, you'd need to likely use the API to find the Option IDs.

Although I'd encourage you to create this as a global custom field in that scenario and place it on each Team-managed Project, to make it possible to use this rule cross-Project :)

Ste

Neta Knyazhansky Caspy
Contributor
November 26, 2023

@Ste Wright OMG! It's working perfectly!

Thank you so much!

Like Ste Wright likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events