I have a workflow called "Test Workflow":
And I want to disable or hide button "Create" of modal dialog "Create linked issue", if the original issue is not "Story" or "New Feature".
Is it possible to do using ScriptRunner?
Or are there other ways to achieve this?
Any help or advices would be greatly appreciated!
Hello,
You should wirte a validator, which will check the issue type and return a error if necessary. it is the right way to do it.
Thanks a lot, Alexey! Could you be very knid to show some examples to clarify how it is possible to do? I have no idea what you mean! Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. Open your workflow and find the create issue transition.
2. Open the validator tab and choose scripted function from ScriptRunner
3. Write code something like this
if (issue.getIssueType().getName() in ["Story", "New feature"]) {invalidInputException =
new
InvalidInputException(
"Choose correct issue type"
)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alexey, thanks for answr. I've tried to implement your above instructions. However, I have no such transition "create issue".
I just have a button "Create lniked issues".
I want to check whether this issue where a button "Create lniked issues" is clicked is a type of "New Feature" or "Task". So there is no such transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I confused the create issue action with the create linked issue.
You should use the Hide UI element built -in.
https://scriptrunner.adaptavist.com/5.4.7/jira/fragments/HideUIElement.html
You should add such a module. Choose the create-linked-issue-item in the Hide What field. Then write a condition in the Condition field.
issue.issuetype?.name == 'your issue type for which to show'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks you very much, Alexey!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are welcome!
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.