- Published on
[Archive] Creating a VIP Flag in Jira Service Desk using a Scripted Field
- Authors
- Name
- Jack Graves
It is a common feature request for a Service Desk to prioritise certain users, who require special treatment to (a) make their requests appear with some kind of indicator and (b) prioritise requests from users in this group.
I'm not going to discuss whether having peoples requests prioritised based on who they are is best practice, but there is an interesting blog post here that covers whether you truly do need a VIP Flag.
How does it look?
The easiest way of creating the actual field on the issue is by using a ScriptRunner Scripted Field and a component of the Atlassian User Interface (AUI) called Lozenges, which you would have most likely seen in the JIRA View Issue screen to signify the status like this:
Instead of showing status with a Lozenge, in this example we are going to use them to show whether an issue was raised by a 'VIP' using a field with some html code in it, like so:
This will be shown on both the JIRA Service Desk queue, if you add the column to the queue:
It will also be shown on the 'View Issue' screen if added to the correct Screen in Jira:
How do I create a VIP Field?
The scripted field can be set up by performing the following steps:
- Install ScriptRunner from the Marketplace/UPM (you can get a free trial with an Atlassian account)
- Add a Custom Field of type Scripted Field.
- Set the Context and description of the field to apply to your Project and Issue Type
- Now, open the User Management section of Jira and create a group for your VIP's, or alternatively, if your users are in Active Directory/LDAP, you can create and manage the group of VIP's within AD to simplify management.
- Enter the script snippet below to add the functionality.
- You can now use the JQL "VIP is EMPTY" for non-VIP's and "VIP is NOT EMPTY" for VIP's in your Dashboards, Filters, Queues and on automation rules.
The scripted field needs the following code:
// This is using the group 'vip-customers' in Jira/AD
// If your JIRA allows Unknown Reporters you should check if the user is valid first:
if(userUtil.getGroupNamesForUser(reporter.name).contains("vip-customers")) {
return "<span class=\"aui-lozenge aui-lozenge-error\">VIP</span>";
} else {
return null;
}
You can also set up an SLA for VIP users using (distict) SLA rules for the different criteria using JQL.
Update: Please note that the above can only be performed on JIRA Server (not JIRA Cloud) and the Scripted Field should use the 'HTML' Renderer in the Scripted Field options.