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
Hi @jaya chandra reddy nellore
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.ComponentAccessor
def customFieldManager = ComponentAccessor.customFieldManager
def 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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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.