Auto transition always returning true

IN the example below...auto transition returns true even though the transition doesn't exist. Is this right?

//

// Trigger BR Req Complete Transtion

//

////////code that sets allApproved True

if (allApproved){

addComment(key,currentUser(),"Auto Transitioning " + %BR%.key);

boolean success = autotransition("Req c (AUTO)",%BR%.key);

if(success)

{

addComment(key,currentUser(),"Auto Transition successful: " + %BR%.key);

}

}

}

2 answers

1 accepted

This widget could not be displayed.

Hi Jim,

In the latest release we changed the autotransition a bit since we had some problems. The autotransition is now called _after_ the script is done executing, so we had no choice but to return a mock value there since we don't actually know the result at that point. We also added a new, optional parameter, which specifies if it should try to force the transition even if the conditions/validators are not met. Please see the doc here.

Regards,

Florin.

Thank you...however the transitions are not firing....

does this mean the autotransition can't be in a loop or an if stmt?

Check out the new parameter and try setting it to true. The autotransition can still be called in a loop or if statement. Each call is registered and postponed until the script is done.

Thanks..but that doesn't seem to be working for me.

I have a condition (SIL Script) that sets the visibilty of the button to false. When another transitoin calls the autotransiton for this button that is hidden with the skipValidation=true, the transition doesn't fire. If I remove hte condiation (which is not desired), everything fires ok.

I can't seem to get the new param to work. Im using commons 2.5.3 and JJUPIN 2.5.1

The realiability of hte autotransition seems inconsistent (now 2.5.2). The Postfunction below sometimes works and sometimes doesn't..

string TARGET_STATUS="Pending System Test";

//if(status==TARGET_STATUS)

//{

for(string R in linkedIssues(key,"DesignElement"))

{

// %R%.customfield_10402=TARGET_STATUS;

//check if all DEs are in pending design

boolean allApproved=true;

for(string D in linkedIssues(%R%.key,"DesignElement"))

{

if(%D%.status!=TARGET_STATUS)

{

allApproved=false;

}

}

if(allApproved)

{

addComment(%R%.key,currentUser(),%R%.key + " was transition from '" + %R%.status + "' to '" + TARGET_STATUS+ "' by Design Element " + key);

print ("##########################" + %R%.key + " was transition from '" + %R%.status + "' to '" + TARGET_STATUS+ "' by Design Element " + key);

autotransition("Dev Complete (AUTO)",%R%.key,true);

//check if all BRs are in pending design

boolean allComplete=true;

for(string B in linkedIssues(%R%.key,"Requirement"))

{

addComment(%B%.key,currentUser(),%B%.key + " was transition from '" + %B%.status + "' to '" + TARGET_STATUS+ "' by Design Element " + key);

print("####################" + %B%.key + " was transition from '" + %B%.status + "' to '" + TARGET_STATUS+ "' by Design Element " + key);

autotransition("Dev Complete (AUTO)",%B%.key,true);

}

}

}

I uncoverd another fact...With logging I see nothing to say that it isn't firing...it looks like it is.. but hte status is not changing.

Please upgrade katl-commons to latest 2.5.4 and see if the problem still persists

I'll have to investigate this further and will let you know as soon as I have a resolution on this. In the meantime, please raise an issue on bugs.kepler-rominfo.com with a detailed description of the problem and steps to reproduce. Thanks.

I already tried that. I've had to rollback to 2.08 to keep my project on track. My client has 2000 users and this plugin the lynchpin in the project. The PO is being generated now, but i'm not sure I can recommend the plugin, until I can see this not break all the transitions currrently created.

Also, please make sure to mention your JIRA version and attach the atlassian-jira.log file with logging set to DEBUG for com.keplerrominfo.

I've just tried out a similar setup and all seems to work fine. Are there any other postfunctions on the transitions that you are calling?

Hi Jim,

We have identified the problem here http://bugs.kepler-rominfo.com/browse/IMJ-59 and a fix will be available with our next release. The above issue also contains a SNAPSHOT version which includes the fix.

Regards,

Florin.

This widget could not be displayed.

Hi Jim,

Have you tried to creat an Exception on this code to verify if the non-existing transition fits in it?

For I what I could see in the code provided, you are only setting conditions for positive results, and so it's hard to diagnose why non-existing transitions are following these conditions. To investigate this, you can try to set this for example:

else (!allApproved){addComment("TEST FOR EXCEPTION")}

As I don't exactly understand your code's environment, I'm not sure if the command above would fit exactly for this test, but then you have a base to perform this test. In case the exception threats the non-existing transitions, then we will understand why was this happening and you will be able to fix it!

Cheers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

533 views 3 19
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you