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