I cannot hide a message field like the way i do with another field. Is it not possible?
def issuetype = getIssueContext().getIssueType().name
def cfField1 = getFieldByName("Type of Service Component")
def cfMessage1 = getFieldByName("C4/C7 Existing Service Message")
def cfMessage2 = getFieldByName("C4/C7 Missing Service Message")
if (issuetype == "C7.R Retailer Initiated Supply Point Address Amendment")
{
cfField1.setHidden(true)
cfMessage1.setHidden(true)
cfMessage2.setHidden(true)
}
else
{
cfField1.setHidden(false)
cfMessage1.setHidden(false)
cfMessage2.setHidden(false)
}
If you intend to use the Behaviour for the Issue Type, this must be done using the Behaviour Initialiser, not the Server-Side Behaviour.
Below is a screenshot of the Behaviour Initialiser configuration for your reference:-
Below is the sample working code for your reference:-
def issueType = issueContext.issueType.name
def sampleList = getFieldByName('Sample List')
sampleList.hidden = false
if (issueType == 'Story') {
sampleList.hidden = true
}
Please note that the sample code above is not 100% exact to your environment. Hence, you will need to make the required modifications.
Below are a couple of test screenshots for your reference:-
1. When the Story issue type is selected as expected, the Sample List is hidden.
2. When any other issue type is selected as expected, the Sample List is visible as shown in the screenshots below:-
I hope this helps to solve your question. :-)
Thank you and Kind regards,
Ram
Hi Ram,
Thanks for your reply. As per my code above ive already set this up as an "Initialiser". It hide certain drop down fields perfectly but it does not hide message fields.
Is it not possible to hide message fields?
Thanks
Rob
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It should be possible when the Create / Edit / Transition screen first appears.
But for more clarity, could you please share a screenshot of which field you are referring to so I can modify my example code accordingly?
Thank you and Kind regards,
Ram
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.
Hi @Robert Bromley welcome to the community. Are you applying this to the field or as the initializer ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The field is on a screen. They wanted to have a message/header between fields
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
:) I was referring to where in the Behaviour you are placing this.
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.
Its set up as an Initialiser in the behaviour, so it take affect on 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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.