Hello, i am currently trying to transition status of an issue through jira rest api but i would like to get the rules of the transition first so we can let user enter the appropriate input that is needed for the transition i am trying to access via
resolver.define("workflowRules", async (req) => {
const { types } = req.payload;
// Extract types from the request context
console.log(types, "types");
try {
const response = await api
.asUser()
.requestJira(route`/rest/api/3/workflow/rule/config?types=${types}`, {
headers: { Accept: "application/json" },
});
console.log(response, "rulesss");
if (response.status === 200) {
const data = await response.json();
console.log(data, "rules");
return data;
} else {
console.error(`Error: ${response.status} ${response.statusText}`);
return { error: `Error: ${response.status} ${response.statusText}` };
}
} catch (error) {
console.error("Error fetching workflow transition rules:", error);
return { error: "Error fetching workflow transition rules" };
}
});
but i am getting empty array in return even though i have made a workflow which has some validators and post functions i also trie making the api call via asApp but was getting 503 error