I am trying to set the Target End Date for an initiative 5 business days after an epic ends. I can read the Target End property by name or by custom field id (e.g., customfield_123456). However, when I try to modify the value using "plusBusinessDays" it errors out.
I've added the following "logging" comment:
issue.customfield_123456 = {{issue.customfield_123456}}
issue.customfield_123456.plusBusinessDays(1) = {{issue.customfield_123456.plusBusinessDays(1)}}
issue.customfield_123456.plusBusinessDays(1).jiraDate = {{issue.customfield_123456.plusBusinessDays(1).jiraDate}}
issue.Target End = {{issue.Target End}}
issue.Target End.plusBusinessDays(1) = {{issue.Target End.plusBusinessDays(1)}}
issue.Target End.plusBusinessDays(1).jiraDate = {{issue.Target End.plusBusinessDays(1).jiraDate}}
Here is the output:
issue.customfield_123456 = 2024-02-03
issue.customfield_123456.plusBusinessDays(1) =
issue.customfield_123456.plusBusinessDays(1).jiraDate =
issue.Target End = 2024-02-03
issue.Target End.plusBusinessDays(1) =
issue.Target End.plusBusinessDays(1).jiraDate =
the problem is that the Target End Date is no real date field from Jira's perspective. You first need to parse the value to a date and then you're able to add the business days. Here's my example for a logging statement:
due date = {{issue.Target end}}, plus business days = {{issue.Target end.toDate.plusBusinessDays(2)}}
Cheers,
Matthias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's great to hear!
In order to help other users find answers quicker, please mark this answer as accepted ✅.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.