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: 

Access Comments on workflow transitions with Scripts

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
avirobbins
721 Views, 7 Replies

Access Comments on workflow transitions with Scripts

I would like to be able to access the comments on the workflow transition to include in an email notification via scripting.  Is this data accessible via scripting?

7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: avirobbins

Hello,

 

item.workflowActions[i].comments should allow access to comments placed on a workflow action.

Message 3 of 8
avirobbins
in reply to: Anonymous

Thanks Eric, so does 'i' represent the workflow action step that you want the comment from?

Message 4 of 8
avirobbins
in reply to: Anonymous

I’m trying to access the workflow comments in a script that fires on the transition to send an email.  I want to put these comments into the email.  I have the code to access the comments item.workflowActions[i].comments (thanks Eric) and can get the comments, however it appears that the script fires before the comments are “saved” to this location.  If I hard code in the action step I can use the comments from the previous transition but if I try to send comments from the current transition I get a blank/null result.  Any ideas?

Message 5 of 8
ThomasRambach
in reply to: avirobbins

Looks like this is still non-functional after 4 years. Any ideas?

Message 6 of 8
john.denner
in reply to: ThomasRambach

Has been working fine for me for a little over a year. I have a process that emails out the last transitions comment. Has worked every time for me.

 

Can you share your script?

Message 7 of 8
aaron.orange
in reply to: john.denner

I am attempting to do the same thing. I can only access the comments if i hard code the transition step. Can you share your script?

Message 8 of 8
john.denner
in reply to: aaron.orange

Not sure if this is what you're looking for, but array element 0 (zero) is that last transition. It's always zero which is pretty helpful. So you'd want to check if the comment is populated and if that's true then do some cool stuff. 🙂

 

if (item.workflowActions[0].comments) {
    // Do cool stuff
}

If comments is populated then it results in true and does cool stuff.

If you need to get a specific comment from a specific workflow transition, it's possible but takes a few more lines of code to step through the workflowActions and test the comment against a string value or with a regex expression. Totally doable though.

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

Post to forums  

Autodesk Design & Make Report