I've raised something to support too (PCS-213544) but I'm hoping I can get some insight from the guy who built it!
I'm not sure if this is an improvement that can be added or whether I'm doing it wrong but I can't get the table.get(name) function to work while in a smartvalue list.
I have a lookuptable set up as a mapping for Organization Name and ID:
ACME: 15
MADE-UP: 8
FICTICIOUS: 26
I'm trying to get a list of matching Organization IDs from the lookup table using by setting a smartvalue as:
So I'm expecting the smart value to contain a comma separated list of Organisation IDs out of the lookup table: ( "15, 8, 26" ). But it never seems to return any data.
I would do this in a branch based on {{#addedFieldChange.values}} instead but then I can't use the smartvalue that I've created outside of that branch to actually make the edit to the Organizations field.
I feel your pain mate. Unfortunately, this is a limitation with the smart value system and not just the lookup table. It isn't possible to refer to outside variables when you're traversing a list. I've tried to do the same myself.
Our smart values guru tried to fix it during the last ship it but ran into some complications. I want this functionality myself, so I'm on his back about getting it fixed but it might have to wait till the next ship it or innovation week I'm afraid.
Nothing you've done wrong, apologies that it doesn't work as you'd like right now!
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.
Glad to hear someone is working on an improvement for refering variables when in smart value lists... Could be really powerful. Is that work being tracked anywhere on JAC that I can subscribe to or anything?
I did have a workaround by branching on {{#addedFieldChange.values}} and then creating a smart value within it for the Edit, which did work but if there were 10 values they'd all try to edit at the same time and conflict... Even when I put random waits in the branch we could only get it working ~ 90% of the time.
I've ended up ditching the lookup table and having over 20 separate IF, ELSE statements to match up the Organization name and edit based on the Org ID which does the same thing... It works but it's ugly and I don't like it.
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.
Yes, the order in .entries doesn't match what's in the UI - it's not showstopping but definitely a nice to have in terms of having the choice to order the lookup table / list in a certain way using jira's smart value functions!
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.
I would love the ability to create them dynamically and also to push values in them along the way. For example I want to create a lookup table of assets, and while branching over the assets is want to store each asset key as the key, and the name of the asset as the value. Later on I could then print these out to a table and add them in comments or text fields.
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.
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.
The more general, automation limitation is: once inside of an iterator, only data from that scope and lower is visible. And so nothing from outside (or higher in scope) can be accessed.
For your scenario, I believe there may be only a few options possible rather than using a Lookup Table:
brute force
Use a long chain of replaceAll() function calls in place of the table get() call
For example: .replaceAll("Galaxy", "Type 1").replaceAll("Stars", "Type 2")...
extra data
Using a different automation rule, when the Team field is set, set another field which contains the Type data
This rule could use the table, as it is directly setting the value of a custom field
Then use the custom field in your message
external service
Build an external service, or find one which can perform a key / value table replacement on a text string, and call it with the Send Web Request action to perform the substitutions outside of Jira
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.
From other communications and community posts, my understanding is the Atlassian team has tried several times to address this limitation without success.
42 comments