Scenario:
We have an Asset object called "Employees", which has among other attributes, one called "Apps list" that stores all applications an user has access to.
Theres another object called Systems which contains all systems and their Sys Admins.
When someone leaves the company, I want to create an automation that creates tasks for the Sys Admins, but only for the apps the user has access.
Ex: John has access to App A and App B, one task for each system and for each sys admin if different.
Within the issue, I have an Asset field with the "Employees" object. From this field, I can find the apps listed in the Employees attribute using the smart value:
{{issue.Employees.App List}} or {{issue.Employees.App List.Name}}
I can do what I want creating tons of "ifs", but I want to make something better. I tried to store the smart value {{issue.Employees.App List}} in a var called {{empApps}}. It works.
Then, I created a lookup table and set App Names grouping by sys admin and that the user in the issue contain it. After that, I created another var to transform the lookup table into string.
The problem is that when I try to do something like: {{tableStr.match("({{empApp}})")}} it just doesnt work. Any thoughts on this?
@Bill Sheboy any chance you have faced something similar? Maybe I dont even need lookuptables for what i need. Thanks
To use a dynamic regular expression with match, such as based on smart values, you need to first store the expression in a created variable.
For an example from the last paragraph in your original question...I am assuming that your tableStr is a comma-separated values list. If not, you may want to investigate the improvements to Lookup Tables to learn what might help: https://community.atlassian.com/t5/Automation-articles/Update-Create-lookup-table-action-improvements/ba-p/2427798
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did find a solution, but couldnt use the lookuptable to list my assets. Thank you anyways!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mauricio Heberle,
This sounds like a really interesting use case, but I'm not quite sure I understand what you are trying to do with 100% clarity. Would you be able to explain exactly which tasks you want created and based on what criteria?
Thanks,
Kian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure, I'll try to be clearer.
Issue containing Asset field object (my own user for testing):
This is the Employee object. I can extract the value from the obj attribute with {{issue.Employees.System Name}}:
Now, lets say someone is the Sys Admin for Jira Software, Figma and OpsGenie. My user has access for Jira Software and Figma, but not OpsGenie. When the IT Offboarding is created, I want to create subtasks for the SysAdmin of those apps, but only for Jira Software and Figma, because those are the ones my user has access.
Eg: Task 1: Remove Access to Figma. Task 2 Remove Access to Jira Software. It doesnt matter if linked or child issue. Example:
The lookup table grouping by the sys admin:
Turning it into string:
I can manipulate this data using match, but what I really want is to compare with the smart value var. This var works, I logged action this and got the right result
The idea here is to create a branch with the {{tableStr.match("({{empApp}})")}} to create an issue for each system. I know its a bit long explanation, but hopefully I made myself clear haha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I found that I can't get the "match" function to work, but I did find that I could do this:
{{tableStr.substringAfter(empApp).subStringAfter("=").subStringBefore(",")}}
Where EmpApp is each individual app the user has.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm, that didnt work. Could you show me your rule, please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was just having it log to the audit log with some test variables.
Are you looping over each value in the empApp variable?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just added the smartvalue you sent to the audit log and no results appeared :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried to branch based on the values stored in empApps?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I did and no results. :/ I
When I changed to {{tableStr.substringBefore(empApp).subStringAfter("=").subStringBefore(",")}}
it showed me only one result of two.
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.