I am currently trying to take data from a multi - select field that the customer fill out and then lookup objects that match the values in this field. Then I would like to add those objects to an insights custom object field on my issue using Jira automation.
Currently I am able to use advanced branching to edit the each value in the multi-select list to match the key of the object using split.
Then I am using lookupObjects to get the key for the two items from the multi select list, but when i try and edit the insight objects field of my issue it only adds one of the two items shown in the log output of lookupObjects.
Wondering what i am doing wrong, or if anyone has a better way of doing this.
Any help would be greatly appreciated.
Welcome to the Atlassian Community!
Can you please check the Asset custom field Double Picker Serial Number# configuration and make sure it is configured to accept multiple objects?
Cheers,
Marini
Additionally, here is how we can make your automation rule more efficient:
objectType = "Double Apple Pickers" and "Packer serial number" IN ({{#issue.Packer Serial Number (NZ)}}"{{value}}"{{^last}}, {{/}}{{/}})
The above smart value will display the following output (assuming the Packer Serial Number (NZ) has 3 values e.g. APB-123, APB-345, and APB-567)
"APB-123", "APB-345","APB-567"
So, the AQL is translated to:
objectType = "Double Apple Pickers" and "Packer serial number" IN ("APB-123", "APB-345","APB-567")
Key IN ({{#lookupObjects}}"{{.}}"{{^last}}, {{/}}{{/}})
The above smart value will display the following output (assuming the {{lookupObjects}} return 3 values e.g. AP-123, AP-345, and AP-567
"AP-123", "AP-345", "AP-567"
So, the AQL is translated to:
Key IN ("AP-123", "AP-345", "AP-567")
Your automation rule will only have 3 components:
Cheers,
Marini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks heaps for this i think its definitely a better way to go for simplification.
I think I have got the object field set to allow multiple as I can definitely select multiple manually.
Sorry i dont think i made it super clear, but the reason i was using the advanced branching is because the values in the Packer Serial Number (NZ) list aren't identical to the key for the objects.
For example:
The packer serial number (NZ) contains the following: "APB-123 Packer 1" , "APB-345 Packer 2"
The objects on the other hand are only identified as "APB-123" and "APB-345".
I was using the advanced branching to split each value on white spaces individually and then taking the first item in the split list.
Does this make sense?
There may be a way similar to what you have done with the single lookup object that can do this?
Thanks heaps for your reply again, much appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Marini Marini
So I have managed to figure out that splitting part i mentioned above and have got it working so thanks heaps, and dont worry about that.
I now have a another issue i'm hoping you will be able to help me with.
There are actually two types of serial numbers that can be selected from the Packer serial number (NZ) APB-123 and AP-123 and each have their respective objects which are a different object type unfortunately.
My question is, Is there a way to check every item in the list for Packer Serial Number (NZ) so that i can call the appropriate lookup object for the serial number that returns?
I have tried using the if else condition however it only checks the first value in the list which is always the serial number AP-123 and does not meet the condition for APB-123.
Do you know of a way to check if any item in the list contains the regex not just the first?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let me know if I understand the requirements correctly.
In this case, your lookup AQL can be as follow:
objectType IN ("ObjectTypeA", "ObjectTypeB") AND "Packer serial number" IN ({{#issue.Packer Serial Number (NZ)}}"{{value}}"{{^last}}, {{/}}{{/}})
Then you can edit the asset custom field, Double Packer serial number#, with the lookup smart value.
Cheers,
Marini
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.