Populate a custom field with the reporter's Department using Jira Automation and API
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
This article explains how to automatically populate a custom field with the Department value from the issue creator's Jira profile using Jira Automation and the REST API in Atlassian Cloud.
The Department attribute from a Jira user's profile is not directly available as a smart value in Jira Automation. As a result, using smart values like {{issue.reporter.department}} will not populate the custom field. This is a current limitation of Jira Automation.
Solution
You can use Jira Automation's Send web request action to fetch the reporter's Department value via the Jira REST API, then set your custom field with the response. This method requires an organization admin API token. There is no workaround for scoped API tokens.
Set up Jira Automation to fetch and populate the Department field
Create an organization admin API token.
Only organization admin tokens can access the required user profile details.
Set up the automation rule:
Trigger: Select Issue created.
Action: Add Send web request.
URL: Use the Jira REST API endpoint to fetch the reporter's profile. For example:
https://your-domain.atlassian.net/rest/api/3/user?accountId={{issue.reporter.accountId}}Method: GET
Authentication: Basic Auth (email address and organization admin API token)
Headers:
Authorization: Basic <base64-encoded-email:api_token>Accept: application/json
Enable Delay execution of subsequent rule actions until we've received a response for this web request.
Action: Add Edit issue to set your custom field.
Use the smart value from the web response to set your custom field. For example:
webResponse.body.account.extended_profile.departmentReplace department with the actual field name from your API response, if different.
The availability of the Department field depends on your user directory and profile configuration. If the field is not present in the API response, consider storing department information in a custom Assets schema or customer detail field and querying that instead.
Important limitations
This solution requires an organization admin API token. Scoped API tokens are not supported for this use case.
If your department data is stored in Assets or as a customer detail field, use the relevant API endpoint to fetch the value and update the issue field accordingly.
There is an open feature request to make user and organization attributes available as smart values in automation rules. You can watch and vote for this feature in Atlassian's public issue tracker.
Was this helpful?