Generate a GUID/TransactionId within an Automation rule

Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2025

Hi,

For an integration I'm building using some automation rules with incoming webhooks and outgoing web requests I'm looking for a way to generate a GUID or some other kind of transaction id which I can then send with my outgoing webrequest as an Identifier.

I couldn't find any existing function or smartvalue so I'm wondering if someone has a solution to either generate one through a couple of math functions or if I'm missing something?

3 answers

1 vote
Manon Soubies-Camy
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2025

Hey @Dirk Ronsmans,

A couple of ideas from the top of my head:

  • Using an external UUID generator (something like this, though I've never used it myself)
  • Using the random function (note: I don't think generated numbers are always the same length):

random.png

  • If you have JSM Premium, leverage Assets and the Unique attribute property?

Hope this helps!

- Manon

0 votes
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2025

Hi Dirk,

You could try to use {{now}} {{random}} to generate a unique ID. Another option could be to store this ID somewhere in jira and add 1 everytime the rule is executed.

Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2025

That was one of the things I was considering to use a now function with a conversion to milliseconds maybe even.

Something else that came in to my mind was to try and use the auditid of the automation itself but doesn't seem like that accessible either.

0 votes
Jovin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2025

Hey @Dirk Ronsmans 

Could you expand on the design of this a little? Some prompting questions and I'll see what I can make of it once answered:

  1. Does the GUID need to match a specific length/pattern/alphanumeric pattern?
  2. Is it likely that a single Jira issue would have more than 1 GUID associated with it during it's lifecycle?
  3. Are the integrations inbound & outbound from Jira? or some other source system acting as the host?
Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2025

Hey @Jovin ,

  1. Not really, a complex string the more complex the better of course. it's used to match a web request to a reponse and also easier for logging to find that specific transaction
  2. A issue would have multiple assigned to it, each time something happens on an issue it could send a web request with a unique id for that specific transaction
  3. it's both ways, but if it's inbound the other system will provide something
Jovin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2025

Thanks @Dirk Ronsmans 

Not sure I can add much more value to this than what the others have said - making use of a UUID generator via API could be good, or leveraging a FOR smart values loop to generate the GUID (numeric only) using the random function if you want to stay inside Jira:

  • Create variable {{guid}} value could be any starting value (e.g. GUID or JIRA or a)
  • FOR Smart value {{guid.length()}} less than X (where X is the length of the GUID you want)
    • Create variable {{guid.concat(RANDOM().remove("0.")}}
  • Lastly, truncate it down to the standard length with Create Variable {{guid.left(X)}} (as it may have appended more than the length you want)

Haven't tested but it could work?

You could then store this as labels (so each one is individually referenceable), or just as a comment on the issue? or append it to a text field with ; or , as a separator?

Suggest an answer

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

Atlassian Community Events