Forums

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

How to set specific field to be required only when I edit ticket from Behaviours-plugin

Kris Han
Contributor
June 10, 2018

Hi, 

I have a question which is how can I set a field to be required only when I use "Edit" button ? I plan to set it on Behaviours plugin. Therefore, If someone who can let me know how to write a script for this on Behaviors will be better. Thank you very much!

 

 

2 answers

0 votes
Mark Markov
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 11, 2018

Hello @Kris Han

To use workflow conditions like in @[deleted] example, you need to provide workflow that your issues use in behaviour settings

Снимок экрана 2018-06-11 в 12.38.32.png

 

But preferable to rule conditions in the code, in this case behaviour not depends on workflow and you can use behaviour on different issue types and workflows

See code bellow:

if (getActionName() == null && underlyingIssue.status.name == "Open"){
getFieldById("comment").setRequired(true)
}

 

0 votes
Deleted user June 11, 2018

Hi @Kris Han,

As the behavior configuration is associated to project, issue type and workflow it will validate the script during any action that is performed.

If you are looking for ignoring these three field related configurations then try to trigger the script only when getActionName()=="" so that it would skip the transitions.

Please let me know if you need further information.

Regards,

Priyanka

Kris Han
Contributor
June 11, 2018

Hi @[deleted],

Sorry, the thing I want is the filed will be required when I "Edit" issue under specific status. For Example,  "Comment" field will be required in "Edit" screen only under "Open" status.

Thank you very much!

Deleted user June 11, 2018

Hi @Kris Han,

Please try to add behavior as shown in the screenshot. This worked for me.

Config.png

Hope this helps.

Regards,

Priyanka

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events