Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Managed Account's Department field's Attribute

Gloria Jazdan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 20, 2024

I'm trying to create an automation rule to update a custom field with the Reporter's Department, which is synced from AzureAD.

However, neither one of those attributes worked {{reporter.accountId.department}}, {{reporter.properties.department}} or {{reporter.department}}

 

Have you seen anything like this before? 

Thanks!

1 answer

0 votes
Manoj Gangwar
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 20, 2024

Hi @Gloria Jazdan 

I see that you are looking for a way to retrieve user information ( Department) using automation.

In this case, referencing our documentation the smart value to retrieve user information does not provide such information: Automation smart values - users

The following properties are accessible for all user smart values:

  • accountId: the unique ID of the user, set by Jira. It is not possible to change this ID. Learn more about converting usernames to user account IDs.

  • active: whether the user's account is active or not

  • avatarUrls: provides access to the user's avatar images in sizes 16x16, 24x24, 32x32 & 48x48

  • displayName: the full name in the user's profile

  • emailAddress: the email address in the user's profile

  • timeZone: the default timezone of the Atlassian Cloud site.

There is a way to retrieve this information, however it only works for Managed accounts.

 

To achieve this you will need to use the User Management API - Get profile REST API call with an Organization API Key.

To create an API key:

  1. Go to admin.atlassian.com. Select your organization if you have more than one.

  2. Select Settings > API keys.

  3. Select Create API key in the top right.

  4. Enter a name that you’ll remember to identify the API key.

  5. By default, the key expires one week from today. If you’d like to change the expiration date, pick a new date under Expires on. You’re unable to select a date longer than a year from the date of creation.

  6. Select Create to save the API key.

  7. Copy the values for your Organization ID and API key. You'll need those to use the API key.

Once you have the API Key then you can use a "Send web request action" to make the REST API call:

Web request URL

https://api.atlassian.com/users/{{issue.assignee}}/manage/profile

Headers

Key            | Value
Authorization  | Bearer <Here you paste the Organization API Key>

Check the option

Delay execution of subsequent rule actions until we've received a response for this web request

After that action is configured now you can use the following smart values to get the information and assign it to a custom field:

Department

{{webResponse.body.account.extended_profile.department}}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events