Need to set a custom field with the assignee/reporter profile data


Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

Summary


As a Jira Administrator, you might need to add information from the managed user accounts profile to your Jira issues.

Environment

.
Jira Cloud.

Solution

This could be performed by Jira Automation and the User Management REST API.


(warning) To use the User Management REST API, you have to use an API key of a user that has permission to execute REST API calls and update and deactivate the accounts owned by your organization (that is, an organization admin). To get the API Keys, please refer to: Manage an organization with the admin APIs

 To create this new Automation rule you can follow these steps: 

  1. Go to Project Settings > Automation > Create rule.
  2. Select a trigger for the rule, in our case, we will use the 'Issue created' trigger.
  3. Select the 'Send web request' action.
    • In the Web request URL enter: https//api.atlassian.com/users/{{reporter.accountId}}/manage/profile
      • We use the Get Profile API call. 
      • we also use the {{reporter.accountId}} smart value to get the user Id, for more information about User Smart Values please refer to: Jira smart values - users
    • In the Headers you should add: 
      • Name: Authorization, Value: Bearer <API-KEY>
      • Name: Accept, Value: application/json
    • in the HTTP method option select 'GET'.
    • Select the 'Delay execution of subsequent rule actions until we've received a response for this web request' checkbox to get the 'webResponse' object. 
      image-2023-06-26-14-05-06-491.png
  4. Select and Update the Issue action and use the {{webResponse.body.account.extended_profile}} smart value to access the data on the user account profile.
    • In the example we get the department from the User profile and added it to the Audit log: 
      image-2023-06-26-14-05-20-547.png




Last modified on Jul 4, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.