Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,227
Community Members
 
Community Events
184
Community Groups

Automation updating summary with variable applied more than once (Jira SD to Jira SD communication)

Edited

Yes, there are plugins for this, but really it shouldn't be required and this solution *does* work, just dirty.

Due to questionable design choices Jira SD does not play nicely with a 2nd SD, as such I've written an automation that picks up external ticket number in their response and adds it my ticket. This works great except for somehow despite the automation only running once it adds the external variable 3-5 times.

Process:

My SD creates ticket "[ABC-123] Summary Text",
client receives and sends standard response "Thanks for your ticket, we raised it as [XYZ-456]

At this point the automation kicks in, checks there is no instance of XYZ in current summary, and then creates two variables:
{{XYZTicket}} = {{issue.comment.last.body.match("(XYZ\W\d\d\d)")}}

and 
{{OldSummary}} = {{issue.summary}}

Then updates Summary with {{OldSummary}} {{XYZTicket}} 

This is proven to successfully update my original ticket from "[ABC-123] Summary Text" to "[ABC-123] Summary Text XYZ-456", this is perfect, the two desks can there-ever after add comments to each others tickets.

Except for some reason it doesn't do that, instead it becomes "[ABC-123] Summary Text XYZ-456, XYZ-456, XYZ-456, XYZ-456" Automation audit log shows only a single processing with ticket successfully updated.

I've also tested by adding a 3rd variable that combines the Old+XYZ and then dropping that into the Summary however it has the same outcome, multiple XYZ. We've also test the same code on the client side and they have the same outcome (also on Jira cloud)

1 answer

0 votes
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 16, 2023

My first thought was: isn't this possible that the root cause is that the regex matcher somehow finds more than matches?

(For example, it produces 4 matches because the pattern contains 4 placeholder characters...)

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.
May 16, 2023

Hi @steven.green 

Yes, and...to what @Aron Gombas _Midori_ suggests, please post images of:

  • the entire automation rule,
  • the audit log details showing the rule execution, and
  • an example comment which was used in the rule.

Those may provide more context to explain this symptom.  Thanks!

Kind regards,
Bill

Ah fair, hadn't thought of that

I've rechecked their responses and its only mentioned twice, once in the email subject (which is dropped in the ticket) and once in the first line of the response.

Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2023 • edited

Tip for troubleshooting:

There is an automation action that can write a log entry to the rule's audit log and which supports smart values. Add the action to your rule after matching the regex, but before updating a summary, and write the smart value {{XYZTicket}} to the log.

Then execute the rule and check the log:

  1. If the log entry contains the value printed as "XYZ-456, XYZ-456, XYZ-456, XYZ-456" -> the problem is with the regex matching and you should try to fix that!
  2. If the log entry contains the value printed as "XYZ-456" -> the regex matching is fine, but then the summary update is broken, you should fix that!

Suggest an answer

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

Atlassian Community Events