Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Post function: "Create Sub task" only works if not edited

Oliver Kurth
March 5, 2020

Heya folks!

I kinda have a strange error I can't figure out. I want a sub task with the name of the month to be created based on the value of a custom field. So I created 12 post functions of 4 different kinds checking if the custom field "period" is set to "yearly", "half yearly", "quarterly", "monthly".

So I'm using the 12 post functions with the follwoing conditions and additional actions:

For post function 1,2,4,5,7,8,10,11:

Condition: issue.issueType.name == 'Task' && cfValues['Period']?.value == 'Monthly'

Additional Action: issue.summary = "January - "+sourceIssue.summary

(and same for February, April, May, etc.)

For post functions 3 and 9:

Condition: issue.issueType.name == 'Task' && (cfValues['Period']?.value == 'Monthly' || cfValues['Period']?.value == 'Quartery')

Additional Action: issue.summary = "March - "+sourceIssue.summary

(same for September)

For post function 6:

Condition: issue.issueType.name == 'Task' && (cfValues['Period']?.value == 'Monthly' || cfValues['Period']?.value == 'Quarterly' || cfValues['Period']?.value == 'Half Yearly')

Additional Action: issue.summary = "June - "+sourceIssue.summary

For post function 12:

Condition: issue.issueType.name == 'Task' && (cfValues['Period']?.value == 'Monthly' || cfValues['Period']?.value == 'Quarterly' || cfValues['Period']?.value == 'Half Yearly' || cfValues['Period']?.value == 'Yearly')

Additional Action:

Additional Action: issue.summary = "December - "+sourceIssue.summary

 

 

With that way I have 12 sub tasks being created if "Monthly is select, 4 sub tasks if "Quarterly" is select, 2 for "Half Yearly" and 1 for "Yearly". And each sub task will start with the correct month name.

All the post functions are working. However, now the problem: when I'm editing one of the post functions, even if I'm copy pasting the same code in, they stop working and do not create the sub tasks anymore. This is always only affecting the edited post function. That is very strange and I can't find the reason for it. The only way to get them to work again is, deleting it and then recreating it, which is painful if I want to change something in all 12 post function.

The error I'm getting then is:

2020-03-05 09:21:34,644 ERROR [workflow.AbstractScriptWorkflowFunction]: *************************************************************************************
2020-03-05 09:21:34,652 ERROR [workflow.AbstractScriptWorkflowFunction]: Script function failed on issue: ITIKS-30, actionId: 261, file: null
java.lang.NullPointerException: Cannot get property 'id' on null object

Does anyone have an idea or did encounter a similar problem? We are working with Jira version 7.12.3, which hopefully we will upgrade soon. But not sure if it may be related to that. I'm grateful for any idea :)

 

In the screen below for example I edited function 12, which was working before but since the edit didnÄt work again even if I copy in the old code. The only time it worked again was when it wasn't triggered:

screen2.PNGscreen1.PNG

2 answers

1 accepted

2 votes
Answer accepted
Nic Brough -Adaptavist-
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 Champions.
February 14, 2012

1. Probably best to set up a different screen-scheme for the sub-tasks, using a different create and edit screen for the sub-tasks.

2. It's calculated, the field is actually "time tracking" and it's worked out from the original estimate and what the users log as work against the issue.

3. As 1, but leave off the time-tracking fields

GilK
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 Champions.
February 14, 2012

Thanks,

We usually set the remaining time for a story, is it a godd idea?

When we log work on a task it adds it to the story remaining time which is not good... because it takes story time + sub tasks time.

Thanks,

Janiv.

Nic Brough -Adaptavist-
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 Champions.
February 15, 2012

I agree with Renjith on that one ;-)

0 votes
Renjith Pillai
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 Champions.
February 14, 2012

Setting remaining time for a story is not a good idea in my opinion. The time tracking should happen only on the sub-tasks and that is meant for the team to see their Sprint Burn Down based on hours. At the same time, the story burn down based on the story points at the Story level is what should be looked at by the Product Owner for his release projection and release date calculations. So the efforts at the story level actually does not make much sense.

And I hope that you do not have any conversion factor you apply for getting story points from an effort estimate. That is totally against the principle of the story point.

The calculated remaining time from a story perspective is again for the team to see how much effort is remaining for the story from the team's view, but not from a Product Owner's view.

Btw, these are just my opinions.

GilK
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 Champions.
February 15, 2012

When do you reach the point when all your stories and tasks are extimated?

Thanks,

Renjith Pillai
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 Champions.
February 15, 2012

Frankly you will never reach that as new stories will be flowing into the backlog continously. But if it is for a particular Epic alone, stories get estimated on a story point basis once we have some fair idea of the epic itself. But task estimations happen only during the sprint planning for the story picked up.

GilK
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 Champions.
February 15, 2012

How deep inside the sprint you estimate your tasks?

do all of them are opened and estimated on the sprint first/second day, or they are opened and estimated on demand - when the user reach the story (theortically this can be the last day of the sprint)?

Thanks,

Janiv.

Renjith Pillai
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 Champions.
February 15, 2012

Sprint Planning itself. If the team can't estimate the tasks for the story that they are planning for the sprint during sprint planning, it indicates that the preparation by the team (called by many names, I am using Grooming) is not good enough. And poker cards are used for the estimate to cut short unwanted discussion and to reach quick consensus.

Without an estimate happening in Sprint Planning, it is somewhat impossible to give commitment to the product owner about the items the teams can do in that sprint.

Suggest an answer

Log in or Sign up to answer