Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation - split doesn't work in advanced branching?

Stefan Draber
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.
March 21, 2025

Hi all,

once again I've got a question about Advanced Branching in Jira Automations. It's such a mighty tool, but I never get it running in the first try :D

My environment is Jira Service Management Cloud. In my request form, I'm offering the customer to pick one or multiple objects from a custom assets field. In a subsequent automation I want to run a branch for every object that is stored in the field. So far it seems to run fine.

Now, this branch runs for every object in the asset field. These objects are returned as [workspaceId]:[objectId] and I need to split this string to use the workspaceId and the objectId in a subsequent web request.

This split-thing works totally fine in a rule _without_ advanced branching, where the customer can only pick one single object:

Rule without Branch - Audit Log.png

 

But when I use the very same logic and actions within a branch, it doesn't work anymore. As you can see from the following screenshots, the string to be splitted is written to the variable correctly. However, the split-function does not seem to work here, as the varObjectId remains empty (same for varWorkspaceId):

(For the split-function, I tried both 

split(":").get(1) 

and 

split(":").last

both with the same result)

 

Branch Rule.png

Branch Rule - Audit Log.png

 

Does anybody have an idea why my approach doesn't work within a branch? And, even more important, does anybody have an idea how to solve it? ;)

Many thanks in advance and best regards,

Stefan

1 answer

1 accepted

3 votes
Answer accepted
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.
March 21, 2025

Hi @Stefan Draber 

My hypotheses of the possible causes are timing or typing-related:

  • The branch is over asset data, and perhaps there is some latency in the just-in-time data look-up which does not provide the information fast enough for the split() to use
  • The data supplied by the branch is not text, preventing the split() from working

 

The mitigation for both may be using a created variable as an intermediary to both force complete lookup and convert to text:

  • advanced branch: over your data, with the variable varKennzeichen
    • action: create variable
      • name: varCurrentValue
      • value: {{varKennzeichen}}
    • ...use {{varCurrentValue}} where you would have used the branch variable

 

If that does not work, I recommend working with your Jira Site Admin to Atlassian Support to take a look as they can directly examine your site data for context: https://support.atlassian.com/contact/#/

When you hear back from them, please post what you learn to benefit the community.  Thanks!

 

Kind regards,
Bill

Stefan Draber
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.
March 24, 2025

Hi @Bill Sheboy 

thanks a lot, creating another variable for the current value solved my issue :)

I can't imagine that it was a timing issue, as the "add to log" action showed the correct data for varKennzeichen right before the split-action.

So it must have been some kind of a data format thing, which has been fixed by just writing it in another variable.

Thanks again for your swift and on-point support!

Like Bill Sheboy likes this
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.
March 24, 2025

I am glad to learn that helped!

And...while writing to the log would fully evaluate the lookup, yet there is no documentation if asset data is cached in rule storage once looked up for a single attribute read (e.g., in the log write)...thus this still could have been a timing problem. 

Although I agree with you: this most likely was a data typing problem :^)

Like Stefan Draber likes this

Suggest an answer

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

Atlassian Community Events