I want to branch over a list of values, in the specific case it is the "Affected Services" field (JSM specific).
For my test, the field contains 3 Values and the Log Action returns: "ServiceA, ServiceB, ServiceC". However, the branch only executes once and the Variable contains the whole list rather than only one value at a time.
My understanding was, that the Branch rule would be like a for each. So for every value in a field, I can execute actions. Therefore, i would have expected the Variable to return "ServiceA" for the first iteration, "ServiceB" for the 2nd and so forth. That doesn't seem to be the case.
Question: Is is a bug or a feature? What am I missing here?
What is the type of your custom field: text, multiple select, something else?
Some field types need to use the split() function to turn them into a list for processing by the branch. For example:
Kind regards,
Bill
Hi @Bill Sheboy
It's not a custom field. Affected Services is a System field that is connected to the "Services" Feature from JSM.
If I change it to {{issue.Affected services.split(",")}} it doesn't return anything at all.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is curious that the type is unknown. I am not using JSM, and so I wonder if this is a dynamic field, calculated just-in-time for usage, which then prevents use in the branch.
The way to check this (and solve your scenario need) is this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It worked now.
I used {{issue.Affected Services.name.split(",")}}
No need for a variable - that was a Layer 8 problem ;) - I didn't know that Automation appends Log messages into one output if there is no action in between.
Now I just need to figure out how to copy the the corresponding Affected Service to each Sub-Task ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well done!
They were objects, similar to iterating over users. Once you have the object, the different attributes need to be accessed.
This how-to article can help when using smart values like this, as it shows the structure and smart values in the issue: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
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.