We have a script that executes on the create transition of our workflow. This basically makes the user add a custom field. The problem we have is when they create this issue via the 'create linked issue' button the custom field is not on that screen hence they cannot create the case.
I know the linked issue screen cannot be changed, so is there a condition i can add to the script to stop it executing if the issue is created via the 'create linked issue'?
import com.atlassian.jira.component.ComponentAccessor
import com.opensymphony.workflow.InvalidInputException
def customFieldManager = ComponentAccessor.getCustomFieldManager();
def CustomFieldValue1 = issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectByName("Retailer ID"));
if(CustomFieldValue1 == null) {
def CustomFieldValue2 = issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectByName("Retailer ID List"));
if(CustomFieldValue2 == null){
invalidInputException = new InvalidInputException("Retailer ID Mandatory")
}
}
You can hide the button using ScriptRunner web fragments: Hide system or plugin UI element
Hide the 'create linked issue' button?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes. You can write a condition for which project and issue types to hide
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thats an option to have i guess. Cheers Alexey!
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.