We have an asset schema that holds user data and syncs daily from Azure AD. When a new hire joins the company, their account is created in AAD, and a corresponding object is created in this user schema with some basic info populated.
We have an automation that's triggered when new objects are created in this schema (when object created in the schema, if objectType = users) with the goal of populating some more fields that aren't provided in AAD.
I'm running into an issue trying to set the "Jira User" attribute in this automation. It's a user-type attribute which I think is complicating things, and I'm not able to simply add an edit-object step and set a value for the attribute. (I've tried things like {{object.Name}}, {{lookupUsers(Name).accountId}}, etc. but the audit log shows errors like "Attribute value is not valid on Objects" or just "Unable to update objects".)
Basically I want to search the values in Jira User for one that matches what's in the user's Name attribute, and set that. From what I've been able to find, assets automation might be able to accomplish this but that doesn't appear to be an option in our instance yet. Is there any way to do this with a regular automation in Jira Cloud?
Hi @Michael Gormley,
You can do that using the automation rule.
Note: Modify the values of the objects and attributes as per your data.
Example-
1- Trigger Scheduled
2- Branch for AQL- write an aql like (objectType = Users and "Jira Account" is Empty"
3- Then add value to the audit log "User email: {{object.email address}}"
4- Send web request:
URL- https://yourjira.atlassian.net/rest/api/2/user/search?query={{object.email address}}
Method: GET
Web request body: Empty
Check the box for the Delay execution
Key - Authorization
Value- Basic and then generate an API token and paste (Example- Basic anNtxhsks2mhdhdddhdhfjfkf)
5- Again, add value to the audit log
(User API) Web Response = {{webResponse.body}}
6- Add {{smart value}} condition for compare two values
First value: {{webResponse.body.size}} Equal Second value: 1
7- Create Variable
Varibale Name: jiraUserAccountid
Smart Value: {{webResponse.body.accountId}}
8- Edit object
select attribute name Jira Account and add the value {{jiraUserAccountId}}
You try this. It should work.
Hi @Manoj Gangwar , thank you for the suggestion. I'm going to see if I can get this working, I'm out next week but I'll follow up once I have a chance to fully test it.
Thanks!
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.
Register today!Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.