Post

4 followers Follow
0
Avatar

Setting actual start date with a workflow

I am trying to setup a workflow that captures the reported date for any time entered against a child project/task at the parent level.  I have an evaluation criteria of:

in($workitem.state, 'Active','Completed','Draft') && (isnull ($WorkItem.Project.Parent.ActualStartDate) || todate (ToOrganizationalDateTime($WorkItem.Project.Parent.ActualStartDate)) > $reportedDate ))

This does exactly what I want it to do when there is in fact a parent project.  Unfortunately I have a few projects that do not have parents.  When I try to enter time against these, I get an error saying the parent is not found.  This makes sense as there is no parent but I don't know what I can do (if anything) to have the workflow run only when a parent actually exists.  

Any help you can offer is greatly appreciated.

Ann Kurtz Answered

Please sign in to leave a comment.

7 comments

0
Avatar

All you need to do is add one extra condition to the rule so that it will not run if a Parent Project does not exist (is null). If you add the line below before your evaluation criteria, that should do the trick:

not(isnull($ParentProject) ) &&

 

 

Josh Santos 0 votes
Comment actions Permalink
0
Avatar

Unfortunately adding the reference to the parent does resolve the issue.  Any other thoughts on what might work?

Ann Kurtz 0 votes
Comment actions Permalink
0
Avatar

Be sure to have the check for Parent Project - (not (isNull ($ParentProject))) - as the first item in the Evaluation Criteria. 

If the check is done after you reference the parent project, it will cause an error when there is no parent project. 

Evan Peterson 0 votes
Comment actions Permalink
0
Avatar

Hi Evan - thanks for getting back to me. Clarizen gives me a syntax error if I try to use (not (isNull ($ParentProject))).  If I use (not (isNull ($WorkItem.ParentProject))) which is what it seems to want, I get the error about no parent project.  I do have the reference listed first in the list.

Ann Kurtz 0 votes
Comment actions Permalink
0
Avatar

Can you post the exact text of the errors that you are getting?  Better yet, can you post a screenshot of the rule?  I'm also going to move this conversation to the Customization section of the community.

Josh Santos 0 votes
Comment actions Permalink
0
Avatar

Hi Ann,

 

Your conditions are stating Project.Parent and not ProjectParent (one word). In addition, since Clarizen is reading the conditions from left to right you need to add the statement Josh and Evan mentioned before the other statements. For example:

 

not isNull($WorkItem.Project.ParentProject) && in($workitem.state, 'Active','Completed','Draft') && (isnull ($WorkItem.Project.ParentProject.ActualStartDate) || todate (ToOrganizationalDateTime($WorkItem.Project.ParentProject.ActualStartDate)) > $reportedDate ))

 

Please let me know if that works.

 

Thanks!

Tamir

 

Tamir Avital 0 votes
Comment actions Permalink
0
Avatar

Hi all - thanks for responding.  I got this to work using the following:  (not (isNull ($Project.ParentProject))).  Appreciate the help!

Ann Kurtz 0 votes
Comment actions Permalink