Requirement:
I tried using a ScriptRunner "Validate details using a Jira Expression" validator, but the validator fails with "Failed to load condition".
My questions:
Has anyone successfully implemented attachment filename validation during a transition in Jira Cloud?
Hi @Ujwala Vallala
For your specific scenario, where the attachment is uploaded during the same transition, I don't believe this is currently possible in Jira Cloud.
Workflow validators, including ScriptRunner Jira Expression validators, cannot reliably inspect the filename of an attachment that is being uploaded as part of the current transition, because the attachment is only available after the transition has been processed.
Similarly, Jira Automation isn't suitable for this requirement, as it runs after the transition completes, so it can react to the attachment but cannot prevent the transition.
If the attachment were already on the issue before the transition, then validating its filename would be a different scenario and could be handled by a validator. However, for attachments uploaded during the transition itself, a custom solution (such as a Forge workflow validator) is likely the only way to enforce this requirement before the transition is allowed.
Can you help me with this scenario:
If the attachment is there on the issue after the transition, then validating its filename and based on that moving the transition to Reject status
Hi @Ujwala Vallala Native Jira can't read attachment filenames in a transition condition or validator, so checking names isn't possible out of the box. If you only need to force a file, a Required validator or a file custom field on the transition screen is the no-app route, but it won't tell you what the file is called.
Disclosure: we build Attachment Manager for Jira Cloud. It lets you define required attachment items per issue type and adds a workflow validator that blocks the transition until those items are uploaded. It checks files already on the issue, so upload first and then transition. It's built around required items, not arbitrary filename rules. https://marketplace.atlassian.com/apps/1226183/attachment-manager-for-jira-cloud?hosting=cloud&tab=overview
It looks like you're new here. Sign in or register to get started.