How do i create functionality for a sub-task status to show in a custom field on parent?

mark rabanal November 7, 2018

My end goal here is to create a custom field on the parent story ticket called QA Task Status ( basically a sub task renamed). I want this custom field to auto populate the QA Tasks status as it transitions from open all the way to closed. 

 

I did some reading and seems I should be leaning towards a script listener using script runner. 

4 answers

0 votes
Ali Türkkan August 18, 2021

Hi,

 

I will suggest a Plugin that will accomplish this task. With this plugin you can show any field in sub-Task in parent issue.

 

You can Download it here: https://marketplace.atlassian.com/apps/1224310/field-teller?hosting=server&tab=overview

Max Foerster - K15t
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 18, 2021

Hi @Ali Türkkan ,

I saw a few posts of you recommending the plugin, so I bet you are a part of the team developing the app? Please have a good read-through of Atlassian Community online guidelines for Marketplace vendors and Solution Partners as they provide guidance on how to act around the community as a marketplace vendor. This includes the various way of identifying yourself as a partner (Vendor name in the user name) and clearly stating your affiliation with the company providing those products or services. Please play fair here as other app vendors are judged by the same standard and please always keep in mind that your primary goal should be to help the user and not solely promote your application as a solution. 👍🏻 

Best, Max

Ali Türkkan August 18, 2021

Hi @Max Foerster - K15t ,

First of all, thank you for the information. I did not know that there was such a directive and that my comment was against this directive. Please, excuse me. I will take your warning into account in my future comments.

Best regards,

Ali Türkkan.

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2018

Hello,

You could also use the Power Custom Fields Premium add-on:

https://marketplace.atlassian.com/apps/1210749/power-custom-fields-premium?hosting=server&tab=overview

The scripts for the field would look like this:

string[] subKeys = subtasks(key);
if (size(subKeys) > 0) {
return subKeys[0].status;
}
return null;
0 votes
Max Foerster - K15t
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 7, 2018

Hey Mark,

another approach next ScriptRunner & Scripts and JSU could be to use a calculated field provided by Jira Workflow Toolbox (developed by my team at Decadis). So you wouldn't have to care about post functions in transitions to update the parent's custom field as it would always be "calculated" (looking up whatever you configured) when it's shown. But I'm curious, assuming you got more than one sub-tasks thought about that already? :D

Best, Max

mark rabanal November 7, 2018

Hi Max,

 

Do you have a link I can review? Is there a trial?

Max Foerster - K15t
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 7, 2018

Hi Mark,

just head over to the Atlassian Marketplace and have a look yourself and you can generate a free trial of every other app there as well and also head over to the documentation. Wish you lots of fun starting to enhance your Jira with one or the other workflow app! That's when the fun begins! 

Best, Max

0 votes
josh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2018

You should look into the Suite Utilities for Jira add-on. It allows you to copy certain field values from the parent-->sub-task and vise versa. 

I believe status will work. You would copy "status" from sub-task to a custom field "QA Task Status" on the parent.

https://confluence-apps.beecom.ch/display/JSU/Copy+Value+From+Other+Field+Post-Function

mark rabanal November 7, 2018

Thanks Josh.

 

I'll give this a try as well. Are you familiar with script runner as I currently have that and would like to play around there as well.

josh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2018

I'm not familiar with Script Runner but I'll see if I can find someone who is.

mark rabanal November 7, 2018

@josh Do you know based on what you shared as i do see the Issue Relation : From Issue in Transition (Must be Sub-Task) to Parent

 

If this just applies anything in my project that is considered a sub-task to this rule?

 

Issue Type Created: QA-task is what is what I am using.

josh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2018

It will apply to every time the workflow is used. So you might want to make sure that the workflow is used only in the appropriate place and for the right issue type. You can also use JSU Preconditions to prevent the Copy from taking place when conditions do not meet what is desired.

mark rabanal November 7, 2018

K Great. Should work then. So I started testing and notice my statuses are always 1 behind.  

 

Story Ticket would show Open in QA Task Status 

QA Task Ticket would show In Progress 

 

@josh

josh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2018

You probably need to reorder your post functions. Put the copy one at the bottom.

mark rabanal November 7, 2018

Thanks @josh works great so far. 

Suggest an answer

Log in or Sign up to answer