The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Make field required while creating for specific issuetype

Jan Sękara
October 1, 2020

HI,

I want to have same workflow for 2 issuetypes, but validate some fields only for one of them while creating the issue.

Any ideas?

PS. I have scriptrunner installed if it helps.

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Bastian Stehmann
Community Champion
October 1, 2020

Hi @Jan Sękara ,

you should be able to achieve this by creating a second field configuration where the field is marked as required and then add this field configuration the field configuration scheme for the issue type where it should be required.

0 votes
Joe Pitt
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 Champions.
October 1, 2020

@Bastian Stehmann answer will work if all you want to do is make the field required. But, when you say 'validate' it makes me think you want to check the field for correctness, which a different field configuration won't do. If what you want is to check the field, I suggest you repost the question asking how to validate a field with scriptrunner when creating an issue. I don't use it so I can't help you.

Jan Sękara
October 1, 2020

I just need to check if the field is present or not.

Joe Pitt
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 Champions.
October 1, 2020

Then using @Bastian Stehmann solution will do that

0 votes
Niranjan
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 Champions.
October 1, 2020

@Jan Sękara - I would say that the better option is to copy the workflow and associate separate workflows to each issue type. If you are keen of using the same workflow, you should consider validating the issue type , when validating the fields. You should do a 'if condition' when adding a scripted validator

issue.issueType.name == 'Bug'

Niranjan
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 Champions.
October 1, 2020

@Jan Sękara 

A simple scripted validator should help

 

https://scriptrunner.adaptavist.com/5.5.7/jira/recipes/workflow/validators/simple-scripted-validators.html

issue.issueType.name == 'Bug' || cfValues['Reason for No Demo']

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events