Forums

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

How do I hide field when issue is created via portal with scriptrunner in JSM Cloud?

Chris Scheepers
Community Champion
July 31, 2023

Hi Team, 

 

I need some help because I am quite exhausted googling and searching through community feeds and trying to make headway with Adaptavists documentation.

 

I dont have experience with coding but have seen it done.

 

We have a field "resource 1" and "resource 2" that should only be visible after a certain step in the workflow . 

So I would like it hidden when the client logs the new engagement request. Only once the ticket lands with the PM's must those fields become visible so that they can allocate the resources...

Here is the requirement :

Fields should be hidden from the form when request is logged

When issue lands at status (allocate resources) where PM's work on it the fields must be visible  and stay visible throughout the workflow and also then be visible in the  Form...

The first status the issue lands in is Setup New Engagement

Get ready to cringe...this was what I came up with 


import com.atlassian.jira.issue.status


def Resourceone = getFieldByName("Resource 1")
def Resourcetwo = getFieldByName("Resource 2")

def StatusField = getFieldById("Setup New Engagement")
def Status = StatusField.getValue() as Status

Resourceone.setHidden(true)
Resourcetwo.setHidden(true)

if(status.name == "Setup New Engagement")

{
Resourceone.setHidden(true),
Resourcetwo.setHidden(true)
}
else
{
Resourceone.setHidden(false),
Resourceone.setHidden(false)
}

 

As you can see , I am fairly lost with script runner.

Any help would be very much appreciated please, even if you can point me to where I can learn more on how to do these things, like where to start.

Thank you

  

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
August 9, 2023

Hi @Chris Scheepers

Could you please clarify what type of fields Resource 1, Resource 2, and Setup New Engagement are?

I am requesting for this information to see if I can provide you with a solution.

Thank you and Kind regards,
Ram

Chris Scheepers
Community Champion
August 10, 2023

Good Morning RAM ,

 

Resource 1 and Recourse 2 are user picker fields .

Setup New Engagement is the first workflow status.

 

In short I need the user picker fields hidden until a certain step in the workflow. They should become visible in the Form at Secure Resources workflow step.

 

new engagement.png

Thank you for trying to assist.

 

kind regards

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events