JMWE: attachment field mandatory

Jurica Petricevic
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.
August 29, 2022

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

2 answers

2 accepted

3 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 29, 2022

Hi @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")
Carlos Faddul
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.
October 10, 2022

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

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 10, 2022

@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?

Carlos Faddul
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.
October 10, 2022

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

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 10, 2022

@Carlos Faddul 

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)
Like Carlos Faddul likes this
Carlos Faddul
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.
October 10, 2022

@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

1 vote
Answer accepted
Marcin Wiktor
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.
August 29, 2022

Hello @Jurica Petricevic

you can try to add a new validator to your workflow that requires "Attachment" field not to be emptyBez tytułu.png. 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:

Jurica Petricevic
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.
August 29, 2022

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

Bild 1.JPGBild 2.JPG

Suggest an answer

Log in or Sign up to answer