Post

2 followers Follow
0
Avatar

Auto Approve Specific Tasks

We have a project setup with generic non project tasks for users to log their time against. I'd like a workflow that auto-approves these tasks so all PM's have to do is review and approve project related tasks.

Can anyone let me know how to setup the workflow please?

Thanks

Martin Jubb Answered

Please sign in to leave a comment.

11 comments

0
Avatar

Hello Martin,

Could you please clarify what you mean by approving tasks?

Thank you!

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

I'm talking about time sheet approval.

I only want PM's to be reviewing project time, not the tasks from the general time keeping project that we have setup.

Cheers

Martin Jubb 0 votes
Comment actions Permalink
0
Avatar

Hello Martin,

Will users submit the timesheets that you want to auto-approve? If so, it's simple, just create the following workflow rule on the Timesheet entity (add more evaluation criteria as needed):

I hope this is helpful.

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

Thanks Roland,

Thats almost got it.  I'm in no way at all a scripter so i guessed at the below to make it work:

IsChanged($State) && $State = 'Submitted' && $WorkItem = 'T-6502'

I've got time sheets setup so they auto submit.  What I've found is that when i add my time against this task it does not get auto approved.  However, if I reopen the time entry and then manually submit it the workflow changes the state to approved.

Can you let me know what I'm missing please?

 

Thanks

Martin Jubb 0 votes
Comment actions Permalink
1
Avatar

Hello Martin,

I suspect this is because when timesheets are auto-submitted, they start off in Submitted state. Try changing the evaluation criteria to $State = 'Submitted' && $WorkItem = 'T-6502' and this time choose a different Run Time option - "When an object is created or when an object is edited and previously did not meet the evaluation criteria".

I hope this works.

Thank you!

Roland Pumputis 1 vote
Comment actions Permalink
0
Avatar

Hi Roland,

Thats got it, thanks.  However, I have multiple tasks that I want to auto-approve.  So what is the best way of doing that?  Can we set the workflow to auto-approve by recognising the project and approve any task in it or do i have to add the individual tasks to the script?

Thanks

Martin Jubb 0 votes
Comment actions Permalink
1
Avatar

Hi Martin,

I think this could work: $State = 'Submitted' && $WorkItem.Project = 'P-12345' (where P-12345 is the project ID).

Please let me know if it does.

Thank you!

Roland Pumputis 1 vote
Comment actions Permalink
0
Avatar

Sorry Roland, one more question.  What if I had more than one project that I wanted to auto-approve.  Do I need individual workflows or can I add them into the same one.  If so, how would that could look?

Thanks

Martin Jubb 0 votes
Comment actions Permalink
0
Avatar

Hello Martin,

Something like this should work: $State = 'Submitted' && ($WorkItem.Project = 'P-12345' || $WorkItem.Project = 'P-12346' || $WorkItem.Project = 'P-12347' )

I hope this answers your question.

Thank you!

Roland Pumputis 0 votes
Comment actions Permalink