We have a special issue type in Jira, which is like a small in sprint. The execution deadline is always the end of next week (next Friday actually), counting from the raise of the issue. And we would like to store the deadline in the issue, that should be calculated by the plugin.
You should use configuration for behavior 1 adding 7 days to it, i.e., using the following time formula:
datePart({00057}, LOCAL) + (dayOfTheWeek({00057}, LOCAL) = 7 ? 7 + 6 : 7 + 6 - dayOfTheWeek({00057}, LOCAL)) * {DAY}
or for improved efficiency
datePart({00057}, LOCAL) + (dayOfTheWeek({00057}, LOCAL) = 7 ? 13 : 13 - dayOfTheWeek({00057}, LOCAL)) * {DAY}
You should replace name_of_special_sprint_issue_type with the actual name of your special sprint issue type.
Once configured, "Create Issue" transition will look like this:
Let's suppose that we want to set "Due date" to next Friday and if today's Friday to next Friday exactly 7 days later. This is not a so easy time calculus as it seems to be. I will explain you to how to do it using Mathematical and date-time expression calculator post-function.
There are two possible desired behaviors:
If today is Friday, we want to set "Due date" to current date (today). In this case we would use the following configuration:
The time formula used is:
datePart({00057}, LOCAL) + (dayOfTheWeek({00057}, LOCAL) = 7 ? 6 : 6 - dayOfTheWeek({00057}, LOCAL)) * {DAY}
If today is Friday, we want to set "Due date" to next Friday, i.e., exactly 7 days later. In this case we would use the following time formula:
The time formula used is:
datePart({00057}, LOCAL) + (dayOfTheWeek({00057}, LOCAL) = 6 ? 7 : (dayOfTheWeek({00057}, LOCAL) = 7 ? 6 : 6 - dayOfTheWeek({00057}, LOCAL))) * {DAY}
Set a field as a function of other fields
Mathematical and date-time expression calculator