Autodesk PLM 360
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Change Milestone State using scripting
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I want to be able to change the workflow state referenced by a milestone via scripting. The WikiHelp seems to suggest this is possible but I have not been able to get it to work. My script is as follows;
item.milestones[0].setWorkflowState('[99] Cancelled');
The Wikihelp states the following;
Methods on the Milestones Array
milestones.setWorkflowState("SHORT_NAME")
Solved! Go to Solution.
Re: Change Milestone State using scripting
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Also,
is it possible to change a milstone date after it has been created using scripting?
Thanks,
David.
Re: Change Milestone State using scripting
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
David,
Workflow states dictate milestones, not the other way around. You can have a workflow state create or adjust a milestone, or look at a milestone for a condition of validation, but you cannot have a milestone adjust a workflow state.
Also yes you can adjust a milestone date via scripting after the milestone is created, if you know the name of the milestone your trying to affect.

Joe Piggee
Support Specialist
Product Support
Autodesk, Inc.
Re: Change Milestone State using scripting
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Joe,
Thanks for the reply. So if I understand you correctly it is not possible to change the workflow state asscoiated to an existing milestone via scripting?
David.
Re: Change Milestone State using scripting
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
David,
There isn’t a way for a script to start based on when a milestone changes. Scripts only work on workflow changes or item creation / change.

Joe Piggee
Support Specialist
Product Support
Autodesk, Inc.
Re: Change Milestone State using scripting
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Joe,
I think we have our wires crossed. The script is executed by a workspace behaviour (edit). All I want to do is change the workflow state referenced by the milestone at that point.
Does that clear things up?
David.
Re: Change Milestone State using scripting
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
David,
If you are trying to change the workflow step based on a milestone. Then you are looking at an ‘if’ or 'case' statement and using:
item.performWorkflowTransition(transID, 'comments')

Joe Piggee
Support Specialist
Product Support
Autodesk, Inc.
Re: Change Milestone State using scripting
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Joe,
I think we still have our wires crossed ;-)
I'll PM you to discuss further.
David.
Re: Change Milestone State using scripting
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Joe,
I have tried to illustrate what I am trying to do on the attached document. Please let me know if this sheds any light.
David.
Re: Change Milestone State using scripting
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
David,
Based on what your showing all you can do at that point is set the “Closed” milestone to completed at 100% and create a new milestone for “Cancel”.
You cannot change one milestone for another or delete and replace the milestone by scripting.

Joe Piggee
Support Specialist
Product Support
Autodesk, Inc.



