Hi,
I have a service desk portal with multiple forms. I have a specific form which I want to be visible to users, but the user should NOT be able to click "create"
I have tried adding a script on the Create transition of the service desk workflow, but nothing happed.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.servicedesk.api.requesttype.RequestTypeService
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
@WithPlugin("com.atlassian.servicedesk")
@PluginModule
RequestTypeService requestTypeService
def currentUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def query = requestTypeService.newQueryBuilder().issue(issue.id).build()
def requestType = requestTypeService
.getRequestTypes(currentUser, query)
.results
.first()
def requestTypeName = requestType?.name
return requestTypeName != "Test request form"
Is there any way this could be done ? I don't want to restrict the form, because that will completely hide it from the portal.