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

Using automation to populate group approvals from Insight

G’day Jira Service Management Community!

My name is Christopher, and I’m an Engineering Manager on the Jira Service Management team.

We recently announced group approvals in Jira Service Management Cloud to support the ability to request approval from groups – not just individual users. Now we’re giving you even more flexibility by extending the same approval criterion to multiple source types.

 

Today, I’m excited to walk you through how you can now use automation to populate the 'Approver groups' field with values from an Insight object schema. Learn more about Insight object schemas.

Who is this guide for?

This guide is for Jira administrators aiming to use Insight as their group approval source, with:

  • Jira Service Management Cloud (Premium or Enterprise plan), and;

  • Some familiarity with Insight configuration, Jira automation, and approvals set up.

Overview of steps

In this guide, I’ll walk you through how to:

  1. Create an Insight object schema with objects. Learn more about Insight object schemas and objects.

  2. Create an Insight objects field. Learn more about the Insight objects field.

    • Add the field to screen during field creation.

    • Configure the field with Insight object field configuration.

  3. Set up approvals on a workflow status. Learn how to set up approvals.

  4. Identify the field id used in the workflow approval configuration.

  5. Add the Insight objects field to the customer portal (optional).

  6. Configure Jira automation to populate approvers based on selected software. Learn more about automation.

  7. Test by raising a request in the customer portal.

 

Without further ado, let’s dive in!

Step 1: Create an Insight object schema with objects

To help bring this to life, we’ll use the example of adding “Service cost center” group approvers to grant a customer’s request to access software.

An object type called Service cost center is created to represents a cost center in the organization.

  • The Service cost center object type has an attribute named Approvers of type group, that is used to store the group(s) associated with the cost center. The cardinality of the Approvers attribute has been updated to support multiple groups (optional). Learn more about cardinality.

  • An object type Software is configured to represent the software being requested, this is the selection the help seeker would perform.

  • The Software object type has an attribute Service cost center that is using the Service cost center object type as the attribute type.

New to Insight? Learn how to get started with Insight in Jira Service Management.

Screen Shot 2021-07-20 at 20.52.38.png

Screen Shot 2021-07-20 at 20.52.46.png

This table shows the list of sample data contained within the schema.

Software (objects) Service cost center (objects) Approvers (groups)

Jira Work Management

Productivity tools

prt-group

Jira Service Management

ts-group

Jira Software

Developer tools

administrators

Bitbucket

Opsgenie

Statuspage

Trello

Financial services

cab

 

Step 2: Create an Insight objects field

An Insight objects field is populated by the agent or help seeker with the selected software that they are requesting access to. Learn how to set up the Insight objects field.

Screen Shot 2021-07-20 at 20.57.36.png

Screen Shot 2021-07-20 at 20.57.47.png

To make the field visible to users, add the field to the screens during field creation.

Screen Shot 2021-07-20 at 20.58.24.png

The Insight objects field is configured to source its data from an Insight object schema. The schema is used to populate the values in the Insight objects field. Learn more about Insight object schemas.

Screen Shot 2021-07-20 at 20.58.49.png

Configure the Insight object field to populate the values from the Insight object schema on the ‘Insight objects’ field.

Screen Shot 2021-07-20 at 20.58.59.png

Screen Shot 2021-07-20 at 21.08.42.png

 

Note: The custom field ID next to the field name customfield_10066 – this will be used later in the Jira automation configuration.

Step 3: Set up approvals on a workflow status

In this example, we are picking the Approver groups field and requiring one approval from each group. Learn how to set up approvals.

Screen Shot 2021-07-20 at 21.05.24.png

Step 4: Identify the field ID used in the workflow approval configuration

In order to configure Jira automation to populate the Approver groups field, the custom field ID needs to be identified first.

Locate the custom field, and select Edit details.

Screen Shot 2021-07-20 at 21.01.31.png

The details view will load for the custom field.

Screen Shot 2021-07-20 at 21.01.57.png

Note the id=10063 in the URL in your browser – the custom field id is customfield_10063 (keep this value for configuring Jira automation).

Step 5: Add the 'Insight objects' field to the customer portal (optional)

In order for the customer to select the Software, the Insight field needs to be visible on the portal request. Learn how to customize the fields of a request type.

Screen Shot 2021-07-20 at 21.07.27.png

Step 6: Configure Jira automation to populate approvers based on selected software

Jira automation is used to identify the Service cost center for the selected software and then populate the Approver groups field with the Service cost center's Approvers groups. Learn how to automate your Jira Cloud processes and workflows.

Configure any trigger point of your choosing. In this example, we used a workflow transition.

Screen Shot 2021-07-20 at 21.55.02.png

Screen Shot 2021-07-20 at 21.55.19.png

Add an Insight action to lookup objects.

Screen Shot 2021-07-20 at 21.55.31.png

IQL has been configured to lookup all objects selected on the software field customfield_10066. Learn more about Insight Query Language (IQL).

Screen Shot 2021-07-20 at 21.55.44.png

Key in ({{customfield_10066}})

Next, add another action to update the Approver groups field on the request (Jira issue), using the Edit Issue automation action.

Screen Shot 2021-07-20 at 21.56.00.pngScreen Shot 2021-07-20 at 21.56.15.pngScreen Shot 2021-07-20 at 21.56.31.png

The provided Approvers group field with ID customfield_10063 is populated with the values from the lookup objects.

Note the path of the lookup traverses the path from the Software object to the Service cost center object, then using the Approvers group attribute configured to contain multiple groups.

{
    "fields": {
       "customfield_10063": [
            {
                "name": "{{#lookupObjects.Service cost center.Approvers}}{{name}}{{/}}"
            }
        ]
        
    }
}

Screen Shot 2021-07-20 at 21.56.51.png

Step 7: Test by raising a request in the customer portal

Screen Shot 2021-07-20 at 21.12.40.png

View the request and perform the transition to enter it into the status that requires approval.

Screen Shot 2021-07-20 at 21.13.13.png

Notice the Approvals needed message after the rule was triggered. This is because the Approver groups field was populated via Jira automation.

Screen Shot 2021-07-20 at 22.01.12.png

Three approvals are required, one from each group, as configured during workflow approvals configuration.

Screen Shot 2021-07-20 at 21.58.03.png

And voilà! You’ve used Jira automation to use the associated group on an Insight object as an approval source.

In the comments below, please let us know if this content is helpful, and feel free to share any approval tips or best practices.

Cheers,

Christopher

 

5 comments

Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 2, 2021

Great guide!

We use this method a lot but were always using scriptrunner to do it (on server that is).

Nice to see a way of implementing this with Automation!

Benoit Heylens August 27, 2021

Hey @Dirk Ronsmans , can you develop how you do that on server ? We lack "backup plan" when a user is not available and/or we need multiple flows of approval from group of people.

Ann Amrani
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!
October 26, 2021

@Christopher Can this be done with a single user picker field rather than a multiple group picker field? I am able to get it to work with a multiple group picker field just as you have it spelled out (thank you!) but when I use a User field in Insight as the source, it doesn't update the single user picker field in JSM, so the ticket still indicates no Approvers have been added. Your input on this is greatly appreciated! (Or anyone who has the answer)

Basically, I want to have a resource's single Manager in Insight to automatically populate as the Approver when the ticket is created.

Ann Amrani
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!
October 27, 2021

I found an answer to the question I posted above if it helps anyone reading this thread in the future. See https://confluence.atlassian.com/jirakb/auto-populate-insight-attributes-into-jira-insight-custom-field-1085208173.html - this provides instructions to populate single values from an object's attributes as opposed to groups. (Cloud)

Like Christopher likes this
Benoit Heylens October 27, 2021

@Ann AmraniUnfortunately, this does not work in Jira Server, as far as I know.

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events