I’m trying to set up an automation that uses an issue creator’s department (from their profile) to set a custom field but can’t seem to get it working.
So far I’ve tried a bunch of smart tags in the json such as {{reporter.department}} and it shows success in the audit but clearly the tag is wrong as it’s still blank in the target field.
any help would be greatly appreciated
I don't think you can access the Reporter's profile from the Automation Issue Smart Value. The user profile is not stored in an issue.
I found the Cloud User Management REST API, Get Profile. But, the user who executes the REST API must have permission to update and deactivate the accounts owned by your organization. So, before you try the above REST API:
I hope the above answer helps!
Regards,
Marini
@Marini Marini This worked a treat. The only issue I encountered was with the documentation for smart fields.
The docs stated to use {{reporter.accountID}} but it actually has to be {{issue.reporter.emailAddress}} on this Link
Thank you for your response, this has been causing me a bit of frustration and this was easy to do with your answer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Old post, but it's still at the top of google, so here's how do to this now... basically still same solution, but updated link and an example...
The endpoint to get user profile data is:
https://api.atlassian.com/users/{{issue.reporter.accountId}}/manage/profile
Doc is now at here.
You need an Organization API Token to call it. This is different than the Jira API Token. You will also want to make sure "Delay execution..." checkbox is ticked, so the rule won't keep running without the response. Also, hide your authorization header...
The response contains the Department in :
{{webResponse.body.account.extended_profile.department}}
After that, it's pretty straightforward:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.