selecting from a group
February 14, 2019

Getting started with Users and Groups in Jira

Sophie Conner 3 minute read

This is the first in a series of blogs that aim to show the capability of the script collections in the Adaptavist Library.

Collections are a group of scripts that have similar functionalities, meaning that you can easily find the scripts that may benefit you.

First up, we will be exploring the collection ‘Getting started with Users and Groups in Jira’. One of the basic actions administrators have to take on a regular basis is keeping the Users and Groups in sync with the onboarding and offboarding of employees. This collection is to help you make bulk actions easy, such as updating all users in a group at once.

Jira user groups

Script 1 - Jira User Properties

User properties enables you to store data that’s specific to user/s, such as location, job role, or phone number. This script allows you to add multiple properties for multiple users with the same script; saving you the task of adding each item manually.

For example, this may be useful if you raise a support request in Jira as you can route the ticket to users who service that location in the issue workflow.

Script 2 - Remove Specified Users from a Group

There are two ways that you can use this script, either from the ScriptRunner Console as a single script, or as part of a larger script facilitating other features in ScriptRunner for Jira.

Perhaps you want to keep your instances clean and tidy? Use this script along side the ‘Deactivate Idle Users’ script, the inactive users will be shown and the ‘Remove Specified Users from a Group’ script will remove them from all the groups they’re part of.

Script 3 -  Validate the User Group of the Assignee

You may want to ensure that only members of a specific group can be can be added as an assignee. This validator script means you can set this up on any transition that you want this check to be enforced on.

Script 4 - Create a User in Jira

Use this script to create a new user in Jira. This snippet benefits you by including validation to check that the user hasn’t already been created. In addition, this script has the ability to collect and log errors for future reference.

Script 5 - Create a Group in Jira

In addition to creating users in Jira, it’s often necessary to create groups. For example, a group can be created when multiple users in your instance need the same permissions or restrictions. This script saves you from adding all the users to the group manually.

What’s Next?

Now you’ve made your administration in Jira easy, keep an eye out for the next post, spotlighting the ‘Working with Dates and Times’ collection and its most common use cases.

Haven’t tried out the Adaptavist Library yet?

Sophie Conner Product Marketing Associate