Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Milestone Status Flag Error

1 REPLY 1
Reply
Message 1 of 2
dkeeley
302 Views, 1 Reply

Milestone Status Flag Error

Hi,

 

I have created a milestone via scripting. The target date is +3 days in the future and the warning date is +7 days in the future. However the warning flag shows up as green (on time) when it should be yellow. I have attached a screenshot. My code is as follows;

 

var milestone = item.addMilestone();
var target_date = new Date();

if (item.URGENCY === '1 - High')
{
    target_date.setDate(target_date.getDate()+3);
}
else if (item.URGENCY === '2 - Medium')
{
    target_date.setDate(target_date.getDate()+7);
}
else if (item.URGENCY === '2 - Low')
{
    target_date.setDate(target_date.getDate()+30);
}

milestone.setWorkflowState('[04] Closed');
milestone.milestoneType = 'ENTER';
milestone.milestoneDate = target_date;
milestone.warnThreshold = 7;
milestone.progress = 100;

Tags (2)
1 REPLY 1
Message 2 of 2
jpiggee
in reply to: dkeeley

David,

 

Because the warning date is set to occur after the target date, this will always show as green. The milestone will turn to red though once the target date is passed.

 

Always make sure the warning date is < the target date. 

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report