Hi Folks,
I have a custom field External ID(text field) now i want to hide Clone option for issues having value in External ID field, I tried fragment script below but it is hiding clone option for all issues.
Script:
Hi @jaya chandra reddy nellore
Could you please share a screenshot of your fragment configuration and a screenshot of your behaviour configuration?
Thank you and Kind regards,
Ram
@Ram Kumar Aravindakshan _Adaptavist_
@Ram Kumar Aravindakshan _Adaptavist_ Please check below screenshot;
From the print screen that you have shared, it appears that you are using Behaviour code for the Fragment configuration. This approach will not work.
You should instead use:-
import com.atlassian.jira.component.ComponentAccessordef customFieldManager = ComponentAccessor.customFieldManagerdef customField = customFieldManager.getCustomFieldObjectsByName('Sample Email').first()def customFieldValue = issue.getCustomFieldValue(customField).toString().toUpperCase()if (customFieldValue.contains("IN")) { false} else { true}
Please note that the sample code provided is not 100% exact to your environment. Hence, you will need to make the required modifications.
Below is a screenshot of the Fragment configuration:-
Also, I am including a few test screens for your reference:-
1) First, the issue is created and the Sample Email field and set the value to in as shown below:-
2) As expected, the Clone option is removed from the More options.
3) Next, the Sample Email field is updated and changed to Tester which doesn't contain the IN characters as shown below:-
4) As expected, the Clone option is not visible as shown below:-
I hope this helps to answer your question.
Also, please respond in this thread as I wrong replied in @Vikrant Yadav's thread.Thank you and Kind regards,
@Ram Kumar Aravindakshan _Adaptavist_ Thanks for code its working.
It looks like you're new here. Sign in or register to get started.