Creating rule around version creation but only when done in admin?

Justin Lehman March 1, 2024

Hello,

I created a rule that when a version is created, a release is then created with that Fix Version(s) associated to it. My problem is, I want this rule to NOT run if a version is created within the ticket. I only want this rule to run when a version is created within the admin version section. I cannot determine how to limit this rule or to create a rule to negate it if a version is created when editing a release ticket. 

image.png

1 answer

0 votes
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.
March 2, 2024

Hi @Justin Lehman 

Natively, I don't believe this is possible. Automation is checking that a version is created from anywhere - not just one location.

I did try to limit it using a different option which was...

  • When version is created
  • If there's no Releases with that version applied (JQL condition)
  • Then created a Release
  • Otherwise, do nothing

...but the issue is that the version in the Release is created before the field is saved, so the rule has already triggered by that point.

---

An alternative would be to delete the duplicate, assuming there should only be one Release issue per version?

This additional rule would look something like this:

  • Trigger: Field Value Changed
    • Fields to Monitor = Fix Versions
    • Change Type = Value added
    • For = Create Issue
  • Condition: Issue Fields Condition
    • Field = Fix versions
    • Condition = is not empty
  • Action: Lookup Issues
    • JQL - issuetype = Release and fixVersion = {{issue.fixVersions.id}} ORDER BY created DESC
  • Condition: {{Smart Values}} Condition
    • Field Value = {{lookupIssues.size|0}}
    • Condition = greater than
    • Second Value = 1
      • Branch: Related Issues
        • Type = Current Issue
          • Branch-Action: Delete Issue

---

A few notes on this rule...

  • The rule is checking created issues which have a version applied. This rule is separate to your first rule but is being triggered by it. That means you need to allow the second rule to be triggered by the first - to do this...
    • Open Rule details
    • Check (TRUE) the box next to "Check to allow other rule actions to trigger this rule. Only enable this if you need this rule to execute in response to another rule."

---

Let us know what you think!

Ste

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events