Forums

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

specific custom field should become mandatory during Transition screen

Syed Nawaz June 26, 2024

How to achieve when issue is moving to validation state and a specific field should become mandatory , and how to execute this in behaviour ?

Sample 

const abc = getFieldById("customfield_000');

const xxx =getFieldById('customfield_000')

const abcValue = abc.getValue();

if (abcValue == "yes"&& actionName === "Validation") {

xxx.setRequired(true);

}

Could help me on this ?

 

2 answers

0 votes
Andrei Cuzuioc _ScriptRunner_
Contributor
January 13, 2025

Hi @Syed Nawaz ! 

Behaviours feature is now supported on Transition View in Jira Software. You can check the details of this first release, supported fields as well as demo videos here.

Best regards,

Andrei

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 26, 2024

Hello @Syed Nawaz 

Welcome to the Atlassian community.

What is the Type of the project? Get that information from the View All Projects page under the Projects menu.

Is there a specific reason you want to do this with a behaviour rather than using a Validator in the workflow transition?

Syed Nawaz June 26, 2024

Hi @Trudy Claspill 

Project type is Company-managed software. yes am aware of validator and its why because i can easily achieve this same in Jira data center, so i want to replicate it in jira cloud behaviours through script runner.

Could you help me here ?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 26, 2024

Hello @Syed Nawaz 

According to the Behaviours documentation, behaviours are supported on the Create Issue and View Issue screens. I don't believe you can create a behaviour that will be applied during a transition.

Your requirement appears to be that you want to require field A during the transition only if field B has a specific value. Is that correct?

You could use ScriptRunner in a Validator to achieve your requirement.

https://docs.adaptavist.com/sr4jc/latest/features/workflow-extensions/validators

As mentioned in that document you will need to use a Jira Expression instead of the scripting that you are familiar with from Jira DC.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events