How to make Attachment field mandatory based on custom field value selection while creating issue using script runner or any other way?
If you know the code please share.
This can be achieved through workflow validator in the create transition. But you would need any of the third party plugin like JSU, JMWE, or JWT to do this. They have a validator called "Field Required" with the condition validation.
Hope this helps!
Thanks,
Sharu
Empyra Software Solutions
If you've the Jira Misc Workflow Extensions (JMWE) app installed in your Cloud instance, you can very easily achieve your requirement by following below steps:
!!issue.customfield_10004 && issue.customfield_10004.value == "test"
Assuming the custom field (based on which you want the Attachment to be mandatory) is a select-list field: in the above script, replace 10004 with the ID of the custom field and test with the desired option of this field.
Let me know if the field is of a different type or if your requirement is different.
BTW, I'm from Appfire, the vendor of JMWE app.
Regards,
Suprija | Appfire
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @k.vijaya.lakshmi and thank you @Sharumathy Krishnan for mentioning us!
I am part of the support team of Decadis and I would like to offer you a possible solution with our app Jira Workflow Toolbox for Jira Cloud.
It would be possible to prevent transitioning issues with no attachments in the Create transition with the JWT for Cloud Fields required validator. There, it would only be necessary to select the Attachments field as required.
However, as the transition needs to be prevented only if another custom field has a value, our recommendation would be to use the Jira expression validator with an expression similar to the following one in the Create transition:
issue?.customfield_nnnnn != null ? issue?.attachments != [] : true
Please, note that the validation of the first field may vary depending on the type of field and the field ID. To adjust the first part of the expression, it might be useful to take a look at the use case Evaluate custom fields.
If you need more information about this or other implementations, please, do not hesitate to contact us in this thread or via our Support Service Desk or visit our documentation.
Best regards,
Vicente
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you've the Jira Misc Workflow Extensions (JMWE) app installed in your Cloud instance, you can very easily achieve your requirement by following below steps:
!!issue.customfield_10004 && issue.customfield_10004.value == "test"
Assuming the custom field (based on which you want the Attachment to be mandatory) is a select-list field: in the above script, replace 10004 with the ID of the custom field and test with the desired option of this field.
Let me know if the field is of a different type or if your requirement is different.
BTW, I'm from Appfire, the vendor of JMWE app.
Regards,
Suprija | Appfire
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.