Set "End Date" based on "Start Date" + Original Estimate

Casper Frost June 11, 2020

Hi,

I am trying to update the "End Date" of an issue using Jira Automation.

What I want is to use the fact that all my issues have a start date, and when I estimate a given issue and provide an "Original Estimate", I then want to extract the value in that field, add the relevant number of days and set the "End Date" of the issue based on this.

As I am using a plugin (BigGantt) my Start and End dates are in a separate custom field, which I have confirmed are "Date" fields (unsing the /editmeta service).

I have verified that this function gives me the information I want, in this case "1", for 1 day:

issue.timetracking.originalEstimate.remove("d")

 

I have also verified that I can set the date field of the end date using this function:

"customfield_10034" : "{{issue.customfield_10015.plusDays(1).jiraDate}}}"

 

Now I simply replace the 1 with my second statement, with the function from my first statement. However, this doesn't work, I get an invalid JSON error.

{
"fields": {
"customfield_10034" : "{{issue.customfield_10015.plusDays(issue.timetracking.originalEstimate.remove("d")).jiraDate}}}"
}
}

My best guess is that this is a type conversion issue, as the 1 in the first statement is a string, and the input required for the second statement is an int. 

I have not been able to find parseInt (or similar) function.

Any ideas what's going on here, or how to achieve the initial objective?

2 answers

1 accepted

0 votes
Answer accepted
Bill Sheboy
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.
June 11, 2020

Hi @Casper Frost -- Welcome to the Atlassian community!

I have not found a way to nest smart values, using one as part of another function in the automation.  I think there is an open backlog item for Code Barrel (now part of Atlassian) to add the feature.

Best regards,

Bill

Casper Frost June 12, 2020

Thanks Bill, thanks for the quick response!
Happy to hear it's not my coding skills that are the cause - but of course sad that it's not (yet) possible.

1 vote
Mateusz Sołowianiuk
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.
June 24, 2020

Hi Casper,

Generally speaking, answers to your questions are present in wiki pages linked below:
* third info section in Quick start with BigPicture;
* details referring to Start / End date fields in Technical configuration - General - Task configuration.

To make the long story short, BigPicture will automatically calculate End Date based on the Start Date and Original Estimate provided. If, on the other hand, no Original Estimate is provided, the task's duration will be set to 1 day. Please note that this applies only to the newly created tasks - if it is desired to be applied to the existing tasks you will need to map End Date to Original Estimate in task configuration section.

Also, if you decide to use custom Jira fields other than default Start/End Date, it is possible to do so and migrate the data to the newly chosen fields. Please refer to the second bullet point listed above and remember that the results of migrating the dates are irreversible - the documentation on this will provide more information.

I hope that this answers your doubts. However, in case of any further questions, please do not hesitate to e-mail us at support@softwareplant.com.

Best regards,
Mateusz Sołowianiuk - SoftwarePlant Support

Ansar Rezaei
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.
June 24, 2020

Hi @Mateusz Sołowianiuk 

I have the same issue. I'm familiar with this configuration that you mentioned. But the problem is that you don't have an End date in any other issue view If you set the end date to Original Estimate. It just is shown in Bigpicture program and not stored anywhere. 

 

image.png

 

@Casper Frost I have the exact issue that you mentioned. Do you found any solution to it?

Casper Frost June 25, 2020

Hi @Ansar Rezaei , unfortunately I didn't.
To be honest, after the message from @Bill Sheboy I stopped trying to make it work. Hadn't seen the @Mateusz Sołowianiuk's response until now - I'll try that out once I get some more time.

Thanks all.

Like Ansar Rezaei likes this
Ansar Rezaei
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.
June 25, 2020

Thank you so much.
@Casper Frost I also ask it here and I want to solve it this way, https://community.atlassian.com/t5/Jira-Questions/Update-End-Date-by-Start-Date-and-original-Estimate/qaq-p/1415498

Could you help me with that?

Mateusz Sołowianiuk
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.
June 25, 2020

@Ansar Rezaei  I am happy to inform that BigPicture actually saves it in Jira. The plugin automatically creates custom fields Start Date and End Date so that the timelines from the Gantt chart are synchronized to Jira as well. Please see the highlighted area in the screenshot below.

start:end dates.jpeg

Please remember, though, that when discussed BigPicture End Date mapping is in place, no modifications of the End Date field in Jira will be synchronized to Gantt as it's only influenced by Original Estimate in Jira. 

 

I hope that this clarifies. I'm happy to assist in case of any further questions. 

 

Best regards,

Mateusz Sołowianiuk - SoftwarePlant support

Ansar Rezaei
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.
June 25, 2020

Hi @Mateusz Sołowianiuk 

Thanks for your reply.

Let me open my situation more:

I use the Start Date field as the start date and the original estimate as End Date in BigPicture configuration. The big picture automatically calculates the end date in GantView, and I can see it there. I want to save the end date to Jira issue to able to see it when opening the issue. Is it possible now?

Ansar Rezaei
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.
June 25, 2020

Here a screenshot of it. Any suggestions will be appreciated.

image.png

Mateusz Sołowianiuk
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.
June 30, 2020

Hi @Ansar Rezaei 

Please excuse me - the information provided in my last response was incorrect. I confused the configuration for my tests which caused faulty results and findings. The correct info is as follows:

 

When mapping End Date to Original Estimate, the field End Date in BigPicture remains empty, as depicted in the screenshot in your message. Hence, no data is synchronized to Jira. 

 

The good news is, though, that the upcoming version of the plugin - BigPicture 8 - will provide an additional End Date column which allows having end date displayed in the Gantt chart, even when it is mapped to Jira's Original Estimate. Please note that in such a case, it WILL NOT be possible to synchronize this value to Jira. Such an improvement is planned for future releases of BigPicture 8; however, no timelines are available at the moment. 

 

Once again, please excuse me for the initial confusion. I hope that this is clarified now. 

 

Best regards,

Mateusz Sołowianiuk

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events