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,