Jira Automation, increment value in the Title

Peter Fahlstrom March 15, 2021

Hi, I am struggling to understand if the Automation would allow the title of the created issue to change for each occasion it has been triggered. Example. I want the title of the new issue change (increment) to reflect the current quarter it has been created?

1 answer

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 18, 2021

Hello @Peter Fahlstrom ,

This can be accomplished using Smart values and a variable broken into the quarterly values with some if/then logic and JQL identifiers for the variable by Quarter.

As a reference point the documentation for these concepts can be found here:

In the following example I set this up using a manual trigger to simplify it for testing, but depending on the Trigger you want to use you will also want to add in a re-fetch for other trigger use cases that alter the data, as an example if you wanted this to occur on an "issue created" trigger, you need to include a "Re-fetch" action between the Creation of the issue and the create variable action, as the variable cannot be created until after the issue fully exists, and the re-fetch will allow the variable to get data from the issue as it is being created to be used in the automation rule.

So an additional logical breakdown on re-fetching is that data is created in Jira as part of the rule, the re-fetch then caches that original data value in the rule, the variable can then store that cached data element, and reuse the original data to modify data in other portions of the rule.  And a good example of re-fetching the data can be seen in this thread:

Additionally, In the following Example, There needs to be a way to identify the time by quarter variable, I used Q1 - Q4 as the identifier with a breakdown of on the timeframe the issue was created, modify accordingly if you wanted to base the timeframe on something else, such as the resolution date or on an issue updated event:

  • Q1: January – March
    • created >= startOfYear() AND created <= startOfYear(3M)
  • Q2: April – June
    • created >= startOfYear(4M) AND created <= startOfYear(6M)
  • Q3: July – September
    • created >= startOfYear(7M) AND created <= startOfYear(9M)
  • Q4: October – December
    • created >= startOfYear(10M) AND created <= endOfYear()

Screen Shot 2021-03-18 at 11.03.34 AM.png

Sot, the Rule breakdown will be like this:

  • When:
    • Manually triggered
  • Then:
    • Create Variable
      • Variable name "oririonalSummary"
      • Smart Value "{{issue.summary}}"
  • if
    • Matches:
      • JQL
        • created >= startOfYear() AND created <= startOfYear(3M)
    • THEN
      • Edit Issue fields
        • Summary
          • {{oririonalSummary}} : "Q1"
  • Else-if
    • Matches:
      • JQL
        • created >= startOfYear(4M) AND created <= startOfYear(6M
    • THEN
      • Edit Issue fields
        • Summary
          • {{oririonalSummary}} : "Q2"
  • Else-if
    • Matches:
      • JQL
        • created >= startOfYear(7M) AND created <= startOfYear(9M)
    • THEN
      • Edit Issue fields
        • Summary
          • {{oririonalSummary}} : "Q3"
  • Else-if
    • Matches:
      • JQL
        • created >= startOfYear(10M) AND created <= endOfYear()
    • THEN
      • Edit Issue fields
        • Summary
          • {{oririonalSummary}} : "Q4"

If an issue has the summary "test", When the above rule is triggered during each of the quarters the summary will update to one of the following:

  • "test:Q1"
  • "test:Q2"
  • "test:Q3"
  • "test:Q4"

Regards,
Earl

Peter Fahlstrom March 18, 2021

Thanks  Earl, Intriguing solution indeed . I will try this out and let you know outcome, 

 

again, thanks!

Like Earl McCutcheon likes this
Peter Fahlstrom March 22, 2021

Thanks for this @Earl McCutcheon . I tested and the summary of the issue did change according to the current date(quarter). However, I trigger the rules by a scheduled query, Project = AA AND "Epic Name" = "BB" with the intention of creating a task in the Then criteria, how do I apply the create issue in your described hierarchy and make the summery of that task to change accordingly?

 

Once again, thanks for your time

 

//Peter

Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 31, 2021

Hi @Peter Fahlstrom ,

To Isolate to the project = AA, you can simply create the rule as a project level automation vs global automation, this has the benefit of allowing customization of the rule per project and reducing the overall executions towards the Global rule limits, as project-level rules do not have a cap on execution limits where global rules have limits imposed to reduce the overall load on the system, some detail on this can be seen in "View your usage"  and "Explore Jira Cloud plans" for the limits per plan level.

Next applying a create issue trigger to the Rule, you would add it like this if you wanted to isolate to the BB epic name:

Screen Shot 2021-03-30 at 4.23.31 PM.png

 

However, isolating the rule to a specific Epic on the create event, gets a bit tricky as you would need to first create the automation rule for every epic name in advance individually, and a manual update would more than likely be a more sustainable solution for updating the Epic quarter.  So I am not sure I understand the use case here, of tying it to append a single epic and I would recommend standardizing the process to update all epics on creation with a rule like the following so that any time an epic is created it appends the quarter identifier:

Screen Shot 2021-03-30 at 4.36.01 PM.png

OR did I read that wrong and Did you mean that you want the Child issues of that epic to be updated with the Quarter variable created from the parent epic not the creation date of the child issue itself?

If this is the case as an issue can be added to an Epic after it is created, or it can be created tied to epic via populating the EPIC LINK at creation as well, so you would need to add in a rule to meet each unique criteria.

Also, Automation rules cannot act retroactively to modify an issue very easily using a variable from another rule, Retroactive events could be triggered from issue links, using branch rules, but I believe a better idea would be to issue the value on a trigger when an issue is added to an epic and do some transferring of a field from the parent to the child issue.

So the first thought for this would be to create the Epic and add in a modification of a custom field.  First, create a custom field to hold the unique identifier in my example I created a "Select List (Single Choice)" field called "Quarter Created" with the options Q1 - Q4 and modified the IF then statements noted above to include editing this field like the following for each quarter:

Screen Shot 2021-03-30 at 4.49.00 PM.png

 

Then I created a new Rule for the child issues to copy the value from the parent issue when the Epic Link field is modified and then appending the summary as we did on the parent epic.  Being aware of a current limitation in the Epic Link as currently not existing for a trigger event and requiring a workaround covered here is set up as follows:

  • When
    • Issue Updated
  • Advanced Compare
    • IF {{changelog.Epic Link}} Does not equal Empty
  • Then Edit Issue Fields
    • Quarter Created
    • Copy From Epic
  • And: Create Variable
    • TestSummary
    • Smart value:
      • {{issue.summary}}
  • And: Re-fetch issue data
  • And: Edit Issue Fields
    • Summary
      • {{TestSummary}} : {{issue.Quarter Created}}

Screen Shot 2021-03-31 at 2.59.36 PM.png

With this rule, any time the Epic link is updated on the child issue the issue will copy the quarter-created value to the custom field from the epic it is under to then append the value to the end of the summary.

Hope this helps, and is what you were looking for. 

Regards,
Earl

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events