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.
HI @Aisha M
Scripts don't apply on a JSM portal.
On Cloud there are no options to change UI items on the product.
Best solution is to set a validator on the create condition of the workflow used by the work type of the request based on a field required, just don't place this field on the request, so then it can't be created.
Or do place it on the request, but set a validator to be provided an option, that does not exist.
@Marc -Devoteam- For now, the changes I want to implement is on the DC environment.
I cannot find a suitable validator, perhaps a JQL one to imply, customer request type != the form , in order for the create transition to happen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI @Aisha M
Just use a field required validator, just use field from your system, that is not used in the create screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Marc -Devoteam- But the "Customer request type" is not a filed, rather the type of form. So, not sure how a field required validator would help.
Also, we have multiple other forms on the service desk portal. I don't want any of the other forms to be affected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Aisha M
I’d like to better understand the use case here.
For what purpose should the form be visible in the portal if users are not allowed to create requests from it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ugnius Aušra , We are in the process of migrating to Cloud. So, the form deals with app integrations with Jira. Despite the form having a NOTE on stop suggesting things are temporarily on hold, users still go ahead and submit the request. So want to disable to submit/create button.
We want the users to know the form exists, but just that requests cannot happen now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A couple of things might work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.