Forums

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

Hide the "Create" button on a specific form

Aisha M
Contributor
February 20, 2026

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.

4 answers

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
February 28, 2026

Hi @Aisha M

The standard approach to hiding UI Elements via ScriptRunner for Jira DC is to use the Fragment.

However, this is not supported in Jira Cloud as Jira Cloud doesn't have the Hide UI Element built-in script.

As an alternative, I suggest looking into the Issue Security schemes

Thank you and Kind regards,

Ram

 

0 votes
Bret Jacobsen
February 20, 2026

@Aisha M

Let me summarize your scenario to see if I read and understand your scenario correctly.  You have a request on your portal that has a form and you want people to see it but not be able to submit it or create requests with it.

If that is a correct summarization, I have done it before in data center and cloud with a workaround since there is no easy, built-in way to achieve it.  Note that we have already migrated so unfortunately I can't give you exact step-by-step instructions.

Basically, you need to add a new required question to the end of your form that has an impossible validation.  For example, a checkbox or radio buttons that the required choice or number of choices cannot be true.  In cloud, I can add a checkbox with no options but is still required.  I think those are the most elegant ways to misuse validation but you could also have a text field with a maximum number of 0 characters.

You can experiment with different wording for the final question so you can convey why the request cannot be created.

I hope this helps and works for you!

Aisha M
Contributor
February 24, 2026

@Bret Jacobsen Lol, that sounds like a good workaround, but since my org is at a point where they are doing a customfield cleanup in preparation for the cloud migration, not sure if they would be okay. Let me check though

So coming back to your answer, is it more like creating a radio option with no value and then making it required on the form ? 

 

Bret Jacobsen
February 26, 2026

@Aisha M, I understand that they may be at a point where they don't want any more changes to request types.  But I believe this is the simplest, most effective way to prevent a specific request from being submitted.

You are correct.  Creating a radio option with no value and requiring it would be another solution from the same bag of tricks.

0 votes
Marc -Devoteam-
Community Champion
February 20, 2026

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.

Aisha M
Contributor
February 20, 2026

@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

Marc -Devoteam-
Community Champion
February 20, 2026

HI @Aisha M 

Just use a field required validator, just use field from your system, that is not used in the create screen.

Aisha M
Contributor
February 20, 2026

@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. 

Marc -Devoteam-
Community Champion
February 21, 2026

Hi @Aisha M 

You are using form on request types, yes?

Request types are linked to an issue type, an issue type has a workflow linked, so on the create action of the workflow set a field required validator not used anywhere in a request or form.

This will prevent the create action of the workflow to be executed.

 

Aisha M
Contributor
February 23, 2026

@Marc -Devoteam- , I tried adding a JMWE "Field required" validator at the create transition for the request type field. But I get this warning that says "JSM fields might not work as intended" .  . Is that okay ? 

Marc -Devoteam-
Community Champion
February 24, 2026

Hi @Aisha M 

This might not work as JWME conditions can be skipped by JSM.

Lets use another completely different approach, on the permission scheme used for the JSM space, remove "Service Space Customer - Portal Access" on the "Create Issue" permission.

This should prevent any portal user to create an issue.

You will see an error on the JSM project as an agent, but this can be ignored, as tis based on removing this permission.

Aisha M
Contributor
February 24, 2026

@Marc -Devoteam-  But wouldn't altering the permission affect ALL the customer forms on the portal ? I want this limitation on only one form 

Marc -Devoteam-
Community Champion
February 24, 2026

Hi @Aisha M 

Yes it would.

The best option I can give then is use a User Validator, set the criteria, the the user is in a role, best is to think to limit this to the admin role.

0 votes
Ugnius Aušra
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
February 20, 2026

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?

Aisha M
Contributor
February 20, 2026

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 

Alan Bruce
Contributor
February 20, 2026

A couple of things might work.

  • create a required field that is hidden so the form can never be submitted.
  • Add a validator in the Workflow for a field that is not on the form.
  • Create an Automation rule that closes the ticket and emails the submitter with the reason why the request option is not available.
  • I am would just set the permissions on the request type so that only admins can see it and regular users cannot.
  • Move the request type to 'Hidden from portal' for the Portal Group.
Like Christopher Yen likes this
Aisha M
Contributor
February 23, 2026

@Alan Bruce I did try the 1st option. But, it still creates the form even if the field is hidden. And I see a prompt that says "Set default value for hidden field" on the field edit page 

Not sure if I'm doing it right, or if that's how its supposed to be . .  

Alan Bruce
Contributor
February 23, 2026

Yeah, that makes sense that it will not work because you have to provide a default value. The alternative would be to add a validator in the workflow that includes a field that is NOT on the form.

Aisha M
Contributor
February 23, 2026

Yes, thats right. Hiding did nothing

And, adding a field validator on the workflow transition would impact the other forms on the Service Desk portal, wouldn't it not ? . .  So, I'm at a loss

Alan Bruce
Contributor
February 23, 2026

It would impact any other request types that are using the same workflow. You would have to create a unique workflow for this specific request type.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events