Hi Community,
is this even possible?
When moving from the "open" status to the "in analysis" status, the attachment field should be mandatory, but if at least one has already been added during the "create" process, then no additional entry in this field is required.
Best regards
Jurica Petricevic
you can use a "Scripted (Groovy)" Validator with this code:
issue.get("attachment") || getTransitionAttachments()
This requires JMWE 7.0.0 or higher.
Or you can use a Fields Required Validator (JMWE app) and use this Conditional Validation script:
!issue.get("attachment")
@David Fischer does this script have differences to work in the cloud?
I have a similar business rule, to which it is necessary to attach the QA evidence in the transition to follow the process, however I could not even manage it via script or required field in validators.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Carlos Faddul Jira Cloud works completely differently. Any workflow condition or validator must be written in Atlassian's Jira Expressions language.
What is your business requirement?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@David Fischer in this case, in a transition screen, I need to force a new attachment to be attached, for QA evidence on the tests performed.
However I tried several ways, however it does not recognize when it attaches to the transition screen, only when it is in the issue view.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I haven't tested it recently, but this should work in a Build-your-own Validator:
!!issue.attachments && issue.attachments.some(it => it.id == null)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@David Fischer WOW
I just applied and it worked the way the rule needed.
I hadn't thought of that solution.
Thank you so much
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Jurica Petricevic
you can try to add a new validator to your workflow that requires "Attachment" field not to be empty. To do such a thing, go to the "Workflows", "Edit" and then select that transition from "Open" to "In analysis" status and follow this screen:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Marcin Wiktor thx for you time first of all.
Secondly, this does not solve my second part of the problem, where if there is already an attachment, the system ignores this field and releases the transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.