Atlassian Team members are employees working across the company in a wide variety of roles.
April 27, 2023 edited
I'd love to see a screenshot of the rule arrangement, that would help.
Certainly using status.id isn't going to work. I think you may be right in that the scoping problem is dropping visibility of the table. I'll ask the smart values master about it.
Update: confirmed that you're right, it is the scoping issue.
is it possible to loop over the values of the look up table in any way? So something like:
{{#lookupTable.values}}
// use the value here
{{/}}
Or in a key-pair way? (i only need a list of the values). I searched and tested for a while, but couldn't find anything.
Edit: I have found a "workaround" for this. when creating a "Create variable" action and putting the lookup table as value the table gets transformed to a string.
Then a "For each" branch can be created which iterates over {{lookupTableVariable.split(", ")}}. then one can create another lookup table in the branch with a chosen key and as value: {{branchSmartValue.remove("{").remove("}").split("=").get(0)}} (0 for the Key and 1 for the value).
This is not every nice though, but at least it works.
Tables are useless if you don't fill them with 'text values'. If you want to import an asset field, first you must 'convert' it to text with a normal variable (even if the source asset field is type=text). If you try to apply any function over a value imported directly to table, this will fail as empty.
{{tableName.get("tableKey") wil show the value, but
{{tableName.get("tableKey").asJsonObject("value")}} will not work as expected, returning null. It happens with any function (split, replace, etc).
Workaround:
Create variable assetField = {{object.field}}
Create lookup table (tableName) with key=tableKey and value={{assetField}}
@Doug Levitt : In cases like yours, we use an Asset to store huge information. This can be splitted into several tables and also can be retrieved from different automation rules. But I also agree that the limit is to short.
@Nicolas Philip awesome workaround for the custom field variable issue. Reading another post above regarding status references and specifying the attribute, that seems to apply to custom fields as well. I added `.value` to my custom field reference, and it works correctly but not without. I'm testing with a single-select custom field.
@Simmo when calling a custom field value in the smart tag in this case, it is pulling an id instead of the "value" attribute from the custom field choice? Referencing {{issue.custom field}} for instance in an audit log entry seems to pull the value attribute by default, making this a bit confusing. EDIT: I see your post regarding the scoping problem related to status references. Seems to be the same with custom field references.
@[deleted] , I wanted to follow up on the post from @Eric Rosche ... is there an easy way to loop over the keys in a lookup table? I would like to have a table containing "team name" and "slack channel". My intention would be to iterate over all the team names, create a Lookup Issues using the team name as a parameter in the JQL, and then send a Slack message with the results to the team's corresponding channel (from the lookup table). If this is possible, can you please share some example code? Thanks!
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.
Copy your table to a created variable to convert it from an object to text. Let's name that varCopyOfTable
Extract the keys from the resulting text version of the table:
{{varCopyOfTable.split(",").match("(.*)=.*")}}
That works by splitting the table rows back up, then finding the key values to the left of the equals sign. The result could then be split to use as input to an advanced branch for your scenario.
Please adjust the searches accordingly if you have any embedded commas or equals signs in your table values.
Here's a screenshot of how I got this setup via the UI in case anyone else needs a little more help. This builds off of the great advice from @Eric Rosche and @Bill Sheboy.
I am trying to work out a way where we can add user names under Lookup table and add those values in the request participants field based on a day [Monday to Friday].
Any suggestions on this will be very much appreciated.
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.
Have you tried adding a delimited list of the accountId values for the users to the table rows? Once a row is selected, it could be split by your delimiter for use.
@[deleted] that actually worked for me, it gets the right value from the table. I tough I have exhausted all possible quote-bracket combinations, but obviously except this one. Thanks a lot for your help!
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.
After retesting this morning I was not able to repro the symptom I saw where a number stored as a created variable could not successfully look up a table value with get(). I sent you my rule in a separate communication.
I'm going to close comments as they're starting to get a bit unwieldily. If you're after support for this component, best to ask a new question or raise a support request.
42 comments