Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,380
Community Members
 
Community Events
176
Community Groups

How to Calculate Due Date based on Priority field?

Hi, guys need your help here!! :)

I create a field type Calculated (scripted) Date/Time Field (JMCF app) and I want to calculate Due Date based on the creation date and the Priority, including weekends.

For example, if the priority is Critical should add 2 days based on the created date and that's the Due Date. Create date 18/08/20 + 2 = Due Date 20/08/20

So I ran with this solution

I tried to change it a little bit removing the part that excludes the weekends and adding the priorities that we work with,

But in many cases, I got Null as a result or will calculate only this part default : return date(issue.get("created"),5);

I'm not that good coding I'm just trying to use the logic here and is not helping me,

If anyone had an idea of how to calculate this will appreciate very much the help!!

 

Best regards,

1 answer

1 accepted

1 vote
Answer accepted

Hi Ariel,

The formula for the Due date field should be: 

switch (issue.priority.name){
case "Critical" : return issue.created + 2
case "Medium" : return issue.created + 4
}

Regards,

Radhika

Thanks, you saved me!!!

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events