Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I want to restrict request type creation basis user groups

SysAdmin
November 11, 2025

Hi,

There is a particular request type which should be created by a specific user group.

The request is created from the portal.

We have created a scripted validator but that is not working.

The customer permission of the project says Customer who have an account on Jira site can create the request. We cannot change that option.

This JSM Datacenter v5.4.1 and Jira version is 9.4.1

The scripted validator is as below


import com.atlassian.jira.component.ComponentAccessor

def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def groupManager = ComponentAccessor.groupManager

// --- CONFIGURE ---
def allowedGroup = "service-desk-approvers"            // group allowed to create
def restrictedRequestType = "Network Access Request"   // request type to restrict
// ------------------

// Get Request Type value from hidden JSM field
def reqTypeCF = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Customer Request Type")
def requestType = issue.getCustomFieldValue(reqTypeCF)?.toString()

// If it’s not the restricted request type, allow it
if (requestType != restrictedRequestType) {
    return true
}

// Validate group membership
def isInGroup = groupManager.isUserInGroup(user, allowedGroup)

return isInGroup

 

Can you kindly help with this?

 

Regards,

 

2 answers

2 votes
Akhand Pratap Singh
Community Champion
November 11, 2025

Hello @SysAdmin ,

Good Day, Welcome to Atlassian Community!!

You can refer this Document: https://confluence.atlassian.com/servicemanagementserver/restricted-request-types-1453424836.html 

I believe it is available for version 10.10 or above based on this ticket https://jira.atlassian.com/browse/JSDSERVER-195 (I will suggest upgrading your JSM DC version as a best practice)

 

Best Regards,
Akhand pratap Singh

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
December 3, 2025

Hi @SysAdmin

I suggest using ScriptRunner's Behaviour for this requirement.

Please refer to this Behaviour Example in the ScriptRunner documentation.

It clearly shows how to restrict the Issue Type according to the user's role. You will need to modify the condition accordingly so that it will restrict according to the Group.

I have also provided a solution in this Community Post.

I hope this helps to solve your question. :)

Looking forward to your feedback.

Thank you and Kind regards,

Ram

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
5.4.1
TAGS
AUG Leaders

Atlassian Community Events