Auto populate Jira servicedesk organisation from a group

This guide describes how to add all members of a group into a servicedesk organization.

Organisation members will get emails on issues that have the field Organisation on a ticket using default setup.

Second warning, organisations only supports 100 users, do not attempt to add more it will cause performance issues

Step 1. getting the group members

Create an action that has the following setup:

GET {{baseUrl}}/rest/api/2/group/member?groupname=THE_GROUP

Step 2. put the members into the servicedesk organisation

Create an action that has the following setup:

POST {{baseUrl}}/rest/servicedeskapi/organization/THE_ID_OF_JSD/user

Headers:

  • Content-Type: application/json

  • X-ExperimentalAPI: opt-in

Body:

{ "usernames": {{{NAME_VARIABLE}}} }

 

In Variables section add a new Groovy variable called NAME_VARIABLE with this in it

def object = jsonSlurper.parseText(response); def json = jsonOutput.toJson(object.values.name) return json

Â