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.
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.
@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'
@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.
I just need to check if the field is present or not.
Then using @Bastian Stehmann solution will do that
@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']
It looks like you're new here. Sign in or register to get started.