Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×In my workflow, I have a condition that checks the value of a field. If the value is equal to a certain option, an attachment is required, else no attachment is required. The workflow is not working as expected. Here's the issue:
Condition/Validator
Condition: User Notification Required? = Yes - All Staff
Validator: Attachment "field" required
Expected Results
Attachment is attached. User can transition to the status without issue.
Actual Results
Error message still thrown, despite the attachment existing on the issue.
How can I alter my workflow to get this to give me the expected results? NOTE: I must rely on native Jira features. I have no interest in using 3rd party apps/add-ins like script runner. If this is not possible with native Jira functionality, that's ok, just need to know.
Thanks in advance for your help!
Can you add the attachment to that screen? The validator is looking for the attachment in that screen, not the one you've already have in the work item.
You can add the Attachment field to that screen.
Regards
Hey @Aaron Pavez _ServiceRocket_ thank you, this did work.
Is this the only way this validator will work? My worry is my users may attach before they get to this screen. The end result I feel is confusing. Attachment already exists, yet it asks for it again. When I do this, the work item now has 2 of the same attachments.
This also seems to be a bit of a variance in system behavior - my other validators can be filled in beforehand without issue, The attachment on the other hand, seems like a user must submit during the transition (not before like they can with other fields). Do you know why this is?
Thanks so much for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Again!
This happens because the validator will validate during the transition screen. It won't check any existing attachment.
For this, an automation might help. This post has an interesting idea:
Or you go the third-party app way. Either Scriptrunner or JMWE. JMWE its easier.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @jessica_huebner ,
I am Nacho and i am part of Decadis.
If using a third-party app is an option for you, you can easily use our Jira expression validator from our app Jira Workflow Toolbox to check if the issue has an attachment (no matter if it was added during the transition screen or if the issue had one attachment beforehand).
The following Jira expression can be used in the validator to check if the current issue has an attachment, depending on if the corresponding custom field has the desired value:
issue?.customfield_XXXXX?.value == "Yes - All Staff" ? issue?.attachments.length > 0 : true
Please, replaxe "XXXXX" with the id of "User Notification Required" custom field.
The validator should look like the following screenshot:
If you have any question regarding how to apply this validator, please do not hesitate to contact us via our Support portal .
Best regards,
Nacho
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @jessica_huebner
The out-of-the-box Field Required Validator works differently for a few fields, such as Attachments, Comments, and Time Spent. For these fields, the built-in validator enforces that an attachment or comment is added during the transition, ignoring any items that were previously added.
Third-party validators (from apps) behave differently: they always validate against all values, including those added earlier. This has its own consequences—if you want to enforce that a value is provided specifically during the transition, then you must validate values from both the issue
and originalIssue
.
I’m from Forgappify, and we provide an app that includes various validators, including our own Fields Required Validator, which checks whether an attachment has been added either before the transition or during it.
In summary, you have following options:
Use the classic validator if the attachment must be added specifically during the current transition.
Use a third-party validator if the attachment can be added at any point earlier in the workflow (not necessarily during the current transition).
I hope it will help,
Cheers
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.