You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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)
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...)
Yes, and...to what @Aron Gombas _Midori_ suggests, please post images of:
Those may provide more context to explain this symptom. Thanks!
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.