Elements Connect

How to set the Reporter's Manager as Approver from Okta

The need

Some organizations manage their users outside of Jira, typically in user directories such as Okta, Azure AD, Google Workspace, etc. These user directories are used to manage user records which hold useful information, including:

  • First name and last name

  • Job title

  • E-mail address

  • Phone number

  • Staff ID

  • Organization

  • Department

  • Manager

Those organizations use Jira as the main tool for their business processes and operations. In order for those processes and operations to be efficient and effective, users need to be tightly integrated.

A common use case for many Jira Service Management customers is to route approvals to a requestor's manager. 

Solution

Elements Connect and Jira Automation can help automate this, as long as the manager's Jira account ID is stored as a profile attribute in Okta.

Use the power of Elements Connect to fetch the reporter's manager email and Jira account ID combined with the strength of Automation to use that information to set the approver of a request.

How to configure a read-only Connected item displaying the reporter's manager’s e-mail

Prerequisites

  • Have Jira Service Management

  • Have an external user directory (in this example, we use Okta) or an external datasource that holds user records

  • Have Elements Connect installed on your instance

Configuration steps

  1. (Optional) Configure a custom attribute “Manager account ID” for your users in Okta

  2. Configure the connection between Elements Connect and Okta

  3. Configure the read-only connected custom field that fetches the reporter’s manager’s account ID.

  4. Add the read-only Connected custom field to the Service Management project

  5. Create a Post Function in your project to automatically update your connected custom field

  6. Configure an Automation rule to set the Approver on created issues in Automation

Steps

1. Configure a custom attribute “Manager account ID l” for your users in Okta (Optional)

You can skip this step if the manager account ID attribute is already configured on user profiles of your Okta account.

We used an ID and not an email because a Jira user picker only accepts an Atlassian accountID (therefore your users need to have an account ID in Jira).

Okta allows you to add custom attributes to Okta user profiles to define additional attributes that are not available in the base attributes. In this use case, we need to be able to fetch a reporter’s manager e-mail ID attribute so we will add it to Okta.

From Okta’s Profile Editor, a custom attribute named “Manager account ID” was added to user profiles:

Nouveaux visuels documentation Connect (1840 x 900 px) (20).png


You can refer to this article in order to add a custom attribute to Okta user profiles.

Once your attribute is created, don’t forget to filled your users profiles in Okta with the Jira account ID of their manager.

Nouveaux visuels documentation Connect (1840 x 900 px) (21).png

2. Configure the connection between Elements Connect and Okta

We are back in Jira. The first step is to configure the connection to the datasource where your user records are held. In this example, an Okta account is used. This connection is done in Elements Connect.

  • Go to Elements Connect administration by clicking on “Apps”, then Elements Connect

  • Now you need to create a datasource for the Okta account.

Refer to this step-by-step tutorial to configure a datasource to Okta.

After following this tutorial, your Okta datasource should be up and running.

3. Configure a read-only Connected custom field that fetches the reporter’s manager’s account ID

The next step is to configure a read-only Connected custom field that fetches the reporter’s manager’s account ID from the Okta datasource.

image-20261016-143256.png
image-20261016-143314.png
image-20261016-143326.png
Manager Account ID configuration

1 - Query:

/api/v1/users/?search=profile.email eq "${(issue.reporter.emailAddress!"")?replace("+", "%2B")}"

We used "${issue.reporter.emailAddress}" instead of "${currentUser.emailAddress}" because the variable $currentUser can't be used along with post-function as it’s Elements Connect app which would be identified as user when running post-function.

We used ?replace("+", "%2B")}" in the query to handle an email with a specific character like “+”. In our exemple, an email adress is “marketing+clara@elements-apps.com”

2 - Filter:

/expand

3 - Template

${data[0].profile.Manager_account_id}

Refer to this page Writing templates with Apache FreeMarker for details about template configuration.

4. Add the read-only Connected custom field to the Application request project

Now that your connected item is configured properly, you can associate it to a request type in your Jira Service Management project.

  • Directly after saving a custom fields configuration, click on “Add field to portal”

image-20261016-144925.png
  • Or go to Elements Connect admin section and find “Add field to portal” in the “Actions” button.

image-20260827-145711.png
  • Select the targeted project and Request type.

  • Add the Connected custom fields with a drag & drop action in the Work item view, as below:

image-20261016-145457.png

5 - Create a Post Function in your project to automatically update your connected custom field

Then, we need to automatically filled our connected custom field Manager Account ID when the ticket is created, to be used after in our Automation. So we create a Post Function:

Enter the Workflow configuration

Go to your Jira workflow configuration

  • Either through Space settings > Request management > Workflow

  • Or on one of your issue, clicking on the status drop down and selecting View Workflow

image-20261016-145749.png

Then click on Edit workflow.

Identify the transition

Identify the transition during which you want the custom field to be updated.

image-20260827-153018.png
Edit workflow with Create issue selected

Add the Post Function

Under Rules, in the Perform Actions box, click on add Perform Actions rule and select the Update Elements Connect custom field value action.

image-20260827-152121.png

Set up the Post Function

In that frame, you are providing with a recap of all eligible and non eligible fields.

Select custom fields to update on transitions among the eligible ones and click on Add to set up the rule.

image-20261016-145952.png

Don’t forget to update your workflow.

6. Configure an Automation rule to set the automatically set the Approver based on the manager account ID

Go to the project administration of your Jira Service Management project and find the “Automation” section.

Configure a rule that will set the Approver field when the value changes for the “Manager account ID” (automatically changed when ticket is created thanks to the Post Function).

Trigger

When the value of the “Manager account ID” changes for all work item operations

image-20261016-150420.png
Action

Edit the work item fields “Approvers”

image-20261016-150524.png

Here we configure our Action in the “Additional fields” for Approvers to be set according to Elements Connect’s connected custom fields Manager account ID.

Configuration

JSON
  { "fields": { "Approvers": [ { "accountId": "{{issue.customfield_XXXXX}}" } ] } }
  • Publish the rule

For this rule to work, make sure the reporter’s Manager has the appropriate permissions to approve requests in the current project.

Next time you submit a request, you now will see that the reporter’s manager has been automatically set as the Approver of the request:

image-20261016-151035.png


New to Elements Connect?

If this tutorial has stirred your imagination, why not give it a try?

• Try Elements Connect •