Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Dears,
I used Jira API rest for raising the issue from another system, now I need to check a Customefield's value(which is come from another system) if it exists and status was Closed in My Jira, My issue on Jira should be Reopen and update some fields otherwise, I need to raise a new issue.
I'm really appreciated if someone tells me how could achieve this concern.
Hello,
You would need a plugin for it.
For example, you could use the Power Scripts plugin:
You could create a post function with a code like this:
if (#{custom field name} == "required value") {
autotransition("Reopen", key);
}
Thanks for your reply.
So, how can I prevent to raise a new issue if customefield existed and just update the existence issue and reopen it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could write a validator:
string [] keys = selectIssues("customfield = yourvalue");
for (k in keys) {
if (%k%.status == "Closed") {
autotransition("Reopen", k);
return false, "Issue " + k + " was reopened";
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much Alexy,
I used this code but seems its never being fired when I create the issue.
Would you please check below concerns, maybe there is some misunderstanding.
so, would you please assist how can we achieve this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And also please be informed, I don't have access to second system and they just call my jira API for creating an issue and i have to validate the concerns in our(Jira) side
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, it is work now.
just one more thing, how can I get the value of customfield_108987 when the second system calls my API for raising the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.