Auto transition always returning true

jim blizzard March 11, 2013

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

1 vote
Answer accepted
Florin Manaila
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 11, 2013

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.

jim blizzard March 11, 2013

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

jim blizzard March 12, 2013

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

Florin Manaila
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 12, 2013

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.

jim blizzard March 14, 2013

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

jim blizzard March 16, 2013

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);

}

}

}

jim blizzard March 16, 2013

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.

Florin Manaila
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 17, 2013

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

Florin Manaila
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 17, 2013

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.

jim blizzard March 17, 2013

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.

Florin Manaila
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 17, 2013

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?

Florin Manaila
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2013

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.

0 votes
pschaff01
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 11, 2013

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
TAGS
AUG Leaders

Atlassian Community Events