Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Making fields mandatory on Transition using Script runner behaviour

arti_b_patil July 18, 2025

Hello Team,
case - i have 30 fields and i have to make sure when issue moves from "In progress" to "Done" status, if any of the field then system will not allow transition and show an error message that field is empty.
i tried workflow validators but it only show static message, unless i put validator for individual field.
similar case with workflow validator using script runner, message will be static and within same pop up box message comes with concatenated.

Last option is using Script runner behaviour, but my not getting why how to add condition for specific transition in scriptrunner. I am using Jira cloud, so usual documentation is not much help.
please let me know if anyone has tried it before and does it work? or what i can do?

 

1 answer

0 votes
Utkarsh Agarwal
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.
July 18, 2025

Hi @arti_b_patil 

Yes, you can handle this with Behaviours on Jira Cloud now. Behaviours were extended to work on transition screens, which is ideal for your case. You can scope the Behaviour to your project and use a simple condition so it only applies when moving In Progress → Done by checking the transition context (sourceStepName/destinationStepName) and using .setRequired(true) for each field.

For reference, Adaptavist has an official Behaviour example for Cloud that demonstrates how to make a field required based on another field’s value – the same logic applies here, just replace the condition with your transition context:

Make a field required 

This approach gives you proper inline validation (red asterisks and field-level errors) instead of the static messages you get with workflow validators.

Kind Regards
Utkarsh

arti_b_patil July 18, 2025

hi Utkarsh,
thank you for your reply. Yes i saw it and i tired to implement using script give here- https://docs.adaptavist.com/sr4jc/latest/features/behaviours/create-and-modify-behaviours

you can take transition ID like this below and add set required condition.

const transitionToDone = 41; 

 i even tried by adding transition screen but it did not work for me. 

also i am not sure or saw at least function to get from and to status like you mentioned - (sourceStepName/destinationStepName)

Like John Funk likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
TAGS
AUG Leaders

Atlassian Community Events