Forums

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

Transition fields gets empty but workflow having manatory field

Dhurgeswari September 20, 2024

 

I am using issuekey through getting transition fields .but here I am getting empty fields but workflow having manatory field.

My Request like below,

const getTransitionRequiredFields = async (issueKey, transitionId) => {
const config = {};
config.issueFields = await storage.get(‘issueFields’);
config.configData = await storage.get(‘configData’);
try {
const response = await api.asApp().requestJira(route/rest/api/3/issue/${issueKey}/transitions?expand=transitions.fields&transistionId=31,
);
const data = await response.json();
console.log("getTransitionRequiredFields:: ",data);
const transition = data.transitions.find(t => t.id === transitionId);
if (transition && transition.fields) {
console.log(‘Mandatory fields for the Done transition:’, transition.fields);
return transition.fields;
} else {
console.log(‘No mandatory fields for the Done transition.’);
return {};
}
} catch (error) {
console.error(‘Error fetching transition fields:’, error);
}
};

 

 

Response like below
INFO 13:07:57.107 6188a077-7285-4d25-b126-59450a9fddbb
getTransitionRequiredFields::
{
expand: ‘transitions’,
transitions: [
{
id: ‘11’,
name: ‘To Do’,
to: [Object],
hasScreen: false,
isGlobal: true,
isInitial: false,
isAvailable: true,
isConditional: false,
fields: {},
isLooped: false
},
{
id: ‘21’,
name: ‘In Progress’,
to: [Object],
hasScreen: false,
isGlobal: true,
isInitial: false,
isAvailable: true,
isConditional: false,
fields: {},
isLooped: false
},
{
id: ‘31’,
name: ‘Done’,
to: [Object],
hasScreen: false,
isGlobal: true,
isInitial: false,
isAvailable: true,
isConditional: false,
fields: {},
isLooped: false
}
]
}
INFO 13:07:57.116 6188a077-7285-4d25-b126-59450a9fddbb Mandatory fields for the Done transition: {}
but my project throw manatory field alert while moving to done transistion


 

image

1 answer

0 votes
Anandhi Arumugam _Cprime_
Community Champion
September 20, 2024

Hi @Dhurgeswari The transition fields will show you the list of fields present on a transition screen (a little pop up you get when you change status to be able to fill in details on the field). It looks like you don't have a transition screen here, but the field is made mandatory on a validator or somewhere. Please check the configurations. Hope this helps!

Suggest an answer

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

Atlassian Community Events