Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can i have a sub task automatically inherit the assignee of the parent task or story? (Cloud)

Felix Ortiz February 7, 2018

-I have been working in JIRA cloud for about a month.

-No programming experience.

-I am looking for options other than a add-on but i am still open to a add-on.

 

 

2 answers

1 accepted

0 votes
Answer accepted
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2018

Hi Felix,

I believe this is what you're looking for: How to Automatically Map Fields of a Parent Ticket to a New Sub-Task in JIRA Cloud.  Although it does require JIRA Misc Workflow Extensions and once you've enabled it you would do the following:

  • Activate the add-on 'JIRA Misc Workflow Extensions' from https://<base-url>/plugins/servlet/upm/marketplace.
  • While editing the desired workflow, 'Add post function' to the 'Create' transition.
  • Select 'Set Field Value from Parent' and 'Add'.
  • Select the field to apply the transition.
  • Once complete, select 'Publish Draft' to ensure the workflow is applied to your project.

Hopefully this helps.

Cheers,

Branden

Divya Yathagiri Venkata March 19, 2018

Hi Branden,

I am trying to have the sub-task created with the same status as parent. I tried both of the below but the sub-task is still being created with 'New' status when I create one.

I tried to add the post-function 'Copy field value from parent issue (JMWE add-on)' [Set the value(s) of a field to the value of the same field in the parent issue] but this does not have Status field.

I have also tried to add a post function 'Copy Value From Other Field' to copy the status field from parent to sub-task which didn't work either.

How do I achieve this?

Thanks,

Divya

David Fischer
Community Champion
March 19, 2018

Hi Divya,

Jira, and especially Jira Cloud, will not let you set an issue's status. The only way to change an issue's status is through transitions. 

Regards,

David

Divya Yathagiri Venkata March 20, 2018

By transitions you mean manually moving the Sub-task to To Do, InProgress, Resolved etc? We are not on Cloud we are on JIRA server

David Fischer
Community Champion
March 20, 2018

You can trigger transitions using the "Transition Current Issue" or "Transition Linked Issues" post-functions. What you cannot do (or should generally not do, on Jira Server) is modify the Status field directly.

However, on Jira Server, you actually can set the Status field, if you're cautious. You need to use the Scripted (Groovy) post-function with the following script:

if (issue.parentObject)
issue.setFieldValue("status", issue.parentObject.get("status"))
Like Ben_Sumnicht likes this
Divya Yathagiri Venkata March 20, 2018

So, I've tried this.

It basically makes the sub-task to have any one of the transitions predefined? I have to select the transition to-do/inprogress etc when I choose this post-function 'Transition linked issues'.

But What I need here is not the subtask to have some pre-defined status but instead inherit the status of its parent when its created. The status of the parent when the sub-task is created on it might be either one of to-do, inprogress etc. But this post-function instead asks me to select a transition which is not desirable for me. Or am I not doing it right?

David Fischer
Community Champion
March 20, 2018

As I mentioned in my previous post, in that case, try the second approach, based on the Scripted (Groovy) post-function.

Divya Yathagiri Venkata March 20, 2018

The script you posted showed errors when I entered it under Custom Script post-function. So, I've modified it to the below and it shows no errors on the script window.

if (issue.parentObject)
  issue.setStatus(issue.parentObject.getStatus())

But the sub-task still doesn't get the status of the parent though it shows a green tick whenever I add sub-tasks here. Pls see screenshot attached.Post function.pngError in script.png

David Fischer
Community Champion
March 20, 2018

This is not a JMWE Scripted (Groovy) post-function - this is a ScriptRunner post-function. This is why it doesn't work.

1 vote
Richard Herrada
Contributor
January 14, 2022

You could use an automation rule to do this [Note that I did this for a single company managed project and have not rolled it out globally, but theoretically it should work globally too].


Go to project settings > hit automation > make sure your in the project you want to test the rule in > on the right hand of the screen click the blue create rule button.

From there your going to create the following:
[Trigger] When an issue is created,
[Condition] If the issue type is a sub-task,
[New Action] Then: Edit issue fields "Assignee" (in this one make sure to choose copy from parent)

Hit Save. Then publish the rule.

This won't update previously created sub-tasks, but it will work for newly created ones.

Good Luck!


Screen Shot 2022-01-14 at 6.43.48 PM.png

Ben Ernest-Jones
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 16, 2023

We started out there to solve this, with Automations, but now the new limits placed on Automations as of 1 Nov 2023 are so low that with just a couple hundred users Automations reach their monthly limits in about a week and they are now unusable for us.

Richard Herrada
Contributor
November 16, 2023

I think I found another way around that. If your Epics, Standard Issue tickets (Tasks, Stories, etc.) and sub-tasks all use the same workflow, then I do not believe this will work / it may cause errors in other parts of your process.

 

However, if your sub-tasks have a unique workflow then you can set a "post function" when a ticket is "opened" to copy the assignee from the parent. Note 2 things:

  1. Post Functions, currently, do not count against automation rules
  2. The reason the sub-task needs to have its own workflow is because if you do not, then I think the tasks/stories will adopt the assignee of the Epic (which may not be a terrible thing, in some cases).

 

How you would do this:

  • Set up your workflow for the sub-task
  • In the Workflow between the dark circle and the "open" status there should be an arrow. Select that and on the right, select "post function" (see image)

Screenshot 2023-11-16 at 9.59.18 AM.png

 

  • On the Post Function screen, on the right, add a post function
  • Then select the post function option "Copy Value From Other Field" (see image) and at the bottom left, press "add"

Screenshot 2023-11-16 at 10.00.01 AM.png

  • Then select (see image):
    • Assignee
    • Assignee
    • Copy from Parent
    • Notes on this: 
      • (Red Arrows) Because we are selecting "copy from parent" we want to find the assignee of the task/story, which is the source field.
      • (Blue Arrow) This is the field we want set.

Screenshot 2023-11-16 at 10.10.55 AM.png

Like unicorne likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events