Hi,
I'm having issues hiding Custom field type "Message Custom Field (for Edit)" using Behaviours.
The following Behaviour server-side script does not hide the Message Custom Field (customfield_13517) on the Create screen:
def singleIssuePicker = getFieldById("customfield_13515")
def messageCustomField = getFieldById("customfield_13517")
def partnerAgreementCf = getFieldById("customfield_13514")
def optionValue = partnerAgreementCf.getValue().toString()
singleIssuePicker.setHidden(true)
messageCustomField.setHidden(true)
if (optionValue == 'Yes') {
singleIssuePicker.setHidden(false)
}
else if (optionValue == 'No') {
messageCustomField.setHidden(false)
}
I've tested a few other custom field types which hide OK. Is there a difference with the Message Custom Field field type that does not allow it to be hidden like other fields? Is it possible to hide this field type using another method?
JIRA Server 8.3.4
Scriptrunner 5.6.2.1-jira8
Thanks,
Andrew
Hi @Andrew Henders this issue fix is mentioned in this link :- https://bitbucket.org/jibrok/message-field/issues/3
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply Vikrant.
I tried the suggested fix "Set the behaviour switch to “hide” and set setHidden(false) in the server-side script do the job" but the field is still showing.
Note that I'm not using this addon "Message field by JiBrok". I believe I'm using the inbuilt Atlassian field "Message Custom Field (for edit)"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are using a field from the Toolkit Plugin for Jira. As far as I know, this field can't be hidden using SR because it doesn't contain any IDs when displayed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't recommend doing this, but technically it will work.
Add two such div tags above your message:
<div class="field-group">
<div id="customfield_sr_please_hide">
MESSAGE TEXT
</div>
</div>
and in SR behaviour:
def field = getFieldById("customfield_sr_please_hide")
field.setHidden(true)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the update Vikrant. On a positive note, I've just installed and tested the Message Field by JiBrok on our test instance and it works. I'll perform a few more tests. Cheers again for the assistance.
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 @JiBrok Thanks for the solution, new solution for me. :)
We are using Message Field add-on. this solution will help us.
why you are not recommending to do this, is there any wrong impact on JIRA instance or effects other fields as well ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think this will cause any problems with the service or the screen.
I don't recommend doing this, because it's not "obvious behavior", but a life hack :)
Now you remember about this decision but what about your colleagues? This solution works here and now. If something changes in the next version of Jira or SR, it may break.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
okay, thank you @JiBrok
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have added ID but still its not hiding for me
Below are the default value
<div class="aui-message new">
<div id="customfield_sr_please_hide">
<p class="title">
<span class="aui-icon icon-warning"></span>
<strong>International ticket escalation</strong>
</p>
<p> Escalation will go to GICS project as product category contains "IAS" </p>
</div>
</div>
Thanks,
Sid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have a similar problem using Message++ fields that just don't seem to hide from behaviours. I have tried the above code and it does not work in this case. The text gets hidden but not the alert box around it and it doesn't unhide when it should.
All I want is to present a pop up alert in an issue screen when certain options are chosen in the same way they I have other fields appear but there seems to be no way to do 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.