Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Hide or disable "Create" button of modal dialog "Create linked issue"

zaharovvv_suek_ru
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2018

I have a workflow called "Test Workflow":
Test Workflow.png

 

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".

Disable Button.png

 

 

Is it possible to do using ScriptRunner?
Or are there other ways to achieve this?
Any help or advices would be greatly appreciated!

 

1 answer

1 accepted

2 votes
Answer accepted
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2018

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.

zaharovvv_suek_ru
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2018

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!

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2018

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")

}

  

zaharovvv_suek_ru
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 6, 2018

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.

Type of issues.png

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 6, 2018

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'

zaharovvv_suek_ru
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 6, 2018

Thanks you very much, Alexey!

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 6, 2018

You are welcome!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events