JJupin - Auto transition a task after validating that custom fields are not empty.

Hello, 

I have a problem with an autotransition that's been requested. I have attempted to design the workflow two different ways and neither has worked. 

Design 1: 

The Status 'Waiting for training date confirmation' has five statuses. As follows: 

  1. Training date confirmed
    1. moves the status to 'Waiting for WebEx creation'
    2. no screen
    3. Hidden from user in the conditions to be uses for the auto-transition
  2. PDM approval
    1. status remains the same
    2. transition button to only be shown if the corresponding custom field is null (set in conditions) 
  3. TDU approval
    1. status remains the same
    2. transition button to only be shown if the corresponding custom field is null (set in conditions) 
  4. EU approval 
    1. status remains the same
    2. transition button to only be shown if the corresponding custom field is null (set in conditions) 
  5. Intl. approval
    1. status remains the same
    2. transition button to only be shown if the corresponding custom field is null (set in conditions) 

The four approval transitions have no screens and are meant to be removed from the screen once they have been executed by various users and can be executed in any order.

They each also have a post function that filles in the date/time of their corresponding custom field, like so: 

 image2016-2-18 13:26:32.png

I have placed the same sil script on each of the four approval transitions as a post function:

//To autotransition the task to 'Training Date Confirmed' status after verifying that PDM, TDU, EU, & Intl. approvals have a date value. 
if (isNotNull("Training date PDM approval") && isNotNull("Training date TDU approval")&& isNotNull("Training date EU approval") && isNotNull ("Training date Intl. approval")){
    autotransition("Training date confirmed", key);
}

Problems: 

  1. The auto-transition will not fire if the 'Training date confirmed' transition is hidden
  2. If I un-hide the 'Training date confirmed' transition the script will not validate that the custom fields have a value. they will simply advance to the next status.

Design 2: 

Like the design above but with the following changes.

I removed the transition 'Training date confirmed', the four approval statuses remain. 

The approval statuses will now move the task to the next status instead of remaining the same

The sil script post function reads like the following (depending on which transition that it is attached to): 

//To autotransition the task to 'Training Date Confirmed' status after verifying that PDM, TDU, EU, & Intl. approvals have a date value. 
if (isNotNull("Training date TDU approval")&& isNotNull("Training date EU approval") && isNotNull ("Training date Intl. approval")){
    autotransition("PDM approval", key);
}
else
{
    status = {"Waiting for training date confirmation"};
}

For example the above script is the post function for PDM approval only but the script for TDU approval will look  like this: 

//To autotransition the task to 'Training Date Confirmed' status after verifying that PDM, TDU, EU, & Intl. approvals have a date value. 
if (isNotNull("Training date PDM approval")&& isNotNull("Training date EU approval") && isNotNull ("Training date Intl. approval")){
    autotransition("TDU approval", key);
}
else
{
    status = {"Waiting for training date confirmation"};
}

Problem: 

  1. The script will still not validate that the custom fields have a value or not. It will simply advance to the next status. 

Any assistance you can provide or another way of designing this would be greatly appreciated. I've been fighting with this for about three weeks now, trying different things, but nothing I try is working. 

 

Thank you, 

 

Avril 

 

1 answer

Hi,

 

First of all, isNotNull routine expects the parameter without quotes.

Secondly, we have another routine, hasInput, which does pretty much the same think as "isNotNull", but is specific for postfunctions and validators.


Try to use

isNotNull(Training date PDM approval)

or

hasInput("Training date PDM approval")

Both of them should work.

Hope this helps,
Alexandra 

Hi Alexandra, 

Thank you for your response. I tried both of your suggestions. When I removed the quotes for the isNotNull, SIL Manager gave me lots of errors on the syntax. 

I then switched out isNotNull with the hasInput.

Design 1: 

It seems like the script is validating the values but it will not fire the auto-transition either when the 'Training date confirmed' transition is hidden or not. 

Design 2: 

The values are still not validated. The task will transition regardless. 

Any other suggestions?

Thank you, 

Avril 

What version of JJUPIN are you using? I guess the errors from the SIL Manager are because in your case, the name of the custom field contains spaces. Could you try to add an alias to that field and re-check it?

Hi Alexandra, 

I'm using version 3.0.10. I tried your suggestion using an alias no go. I get the following in the logs: 'Training date confirmed' Not hidden from user in conditions. 

2016... /rest/keplerrominfo/jjupin/latest/lf/initPage
[commons.ivm.postactions.TransitionPostAction] Transition not found. Cannot
execute autotransition().

'Training date confirmed' Hidden from user in conditions: 

2016... /rest/keplerrominfo/jjupin/latest/lf/initPage
[jira.commons.ivm.IssueVariableResolver] Script is not running in the context of an issue.Cannot get value for field key


Hi,

 

So you've added in silalises file some lines like this, isn't it?

customfield_10604=dt1;

 

If you now use in your postfunction 

isNotNull("dt1")

what happens? 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Marketplace Apps

Three tips for boosting your board's efficiency with Story Maps

Trello is one of the most effective tools for driving your sprints. It's customizable for every Agile team and product owners and Scrum masters (SM) love it. However, Agile teams often struggle with:...

835 views 2 9
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