Post

2 followers Follow
0
Avatar

Add Task in a different part of the project

I am setting up a workflow that creates a series of related tasks when a task is created. I am already creating three sub tasks when the parent task is created however I also need to create a sub task under a different task for the same project.

How do I target the second task? It will always have the same name but I am not sure how to get the object reference.

Project layout =

Project
Task 1 (Triggers workflow when created)
New Task A
New Task B
New Task C
Task 2 (Already Exists)
New Task D (New task to be created by workflow)

Josh Boutwell Answered

Please sign in to leave a comment.

7 comments

0
Avatar

Hi Josh,

Are you creating the sub tasks individually (one by one - New Object, Task x 3) or in a different method?

Thanks,
Tamir

Tamir Avital 0 votes
Comment actions Permalink
0
Avatar

This is being done through a workflow and I am using the method you cited.

Each task is added individually and then updated with files and other links.

Josh Boutwell 0 votes
Comment actions Permalink
0
Avatar

Hi Josh,

In that case you need to create the sub task with a parent of the New Task B task. The reference to New Task B is being reference as NewObjectX (X stands for 1/2/3...). You'll need to leverage that in the New Sub Task creation.
Please look on this screenshot as a highlevel example: http://i58.tinypic.com/amd1d2.png

Good luck!
Tamir

Tamir Avital 0 votes
Comment actions Permalink
0
Avatar

I am doing two seperate (but related) things in one workflow.

  1. when a task is created I am creating 3 sub tasks. (This is already done.

  2. When a task is created I need to create a task under an existing task elsewhere in the project. This I have not figured out yet.

Using WBS notation I am doing the following (# = task creation that triggers workflow, * = tasks created by workflow)

1
1.1
1.1.1 #
1.1.1.1 *
1.1.1.2 *
1.1.1.3 *
1.1.2
1.2
1.3
1.3.1 *

Josh Boutwell 0 votes
Comment actions Permalink
0
Avatar

Essentially, I need to be able to use 'FindObject' in a workflow. Is there a way to do this?

Josh Boutwell 0 votes
Comment actions Permalink
0
Avatar

I was able to find a solution however it is far from ideal.

I created a new custom field on the project to store a reference to the task I would later need.
I then created a new workflow that is triggered anytime a task with that specific name is created which stores the reference. I can then use this in the workflow to target that location for the new task.

Is there anyway to do this without using up custom fields and workflows?

Josh Boutwell 0 votes
Comment actions Permalink
0
Avatar

Hi Josh,

Sorry for missing your last note. You by doing a run on. You'll need to do New Item Action -> Task--> Run On --> Project->WorkItems and filter by the right criteria (for example TargetObject.Name='Task 2' where $Parent is TargetObject

Please let me know if it makes sense.

Thanks,
Tamir

Tamir Avital 0 votes
Comment actions Permalink