It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Depend upon the select list Value the assignee of subtask has to change Edited

Hi Team,

I have a select list field 

select list : optionsA, optionB and optionC

now when the user create a story if he select the select list value “OptionC” so now if the story has any subtask those all subtask assignee has to change to Reporter of the Story(parent issue).

 

Could you please help how to resolve this issue.

 

Thanks,

Kumar

 

 

2 answers

2 accepted

0 votes
Answer accepted

do you have automation or scriptrunner?

It can be done with any of those plugins. let me know if you use any of them and maybe i can give you some lead

Hello @fran garcia gomera     Thanks for your response we do have script runner for jira plugin 

Could you please help me with the script 

 

Thanks

phanidhar

Question: how does the parent issue linked subtasks before creation? or you want that change to be triggered whenever the select field is changed to option C?

I will give an example

 

Now when the user created a Story if he select the “optionC” select list value while creating or after creating now if they create any subtask after creating the Story those linked subtask assignee has to chance to reporter of the Story automatically.

 

if the Story does not have any linked subtask then we don’t require any automation changing assignee

 

If you did not understand the example please do let me know I will explain more detail.

 

Thanks,

kunar

0 votes
Answer accepted

ok, you will need a postfunction in the creation of the subtask. 

Think this should work, maybe you need somefine tuning

import com.atlassian.core.util.DateUtils
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import java.sql.Timestamp;
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.MutableIssue

def issueManager = ComponentAccessor.getIssueManager()

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def changeHolder = new DefaultIssueChangeHolder()

def parentissue = issue.getParentObject()

def cf = customFieldManager.getCustomFieldObjects(parentissue)?.find { it.name == "your_fieldname" }

if (parentissue.getCustomFieldValue(cf).toString()=='option C'){
log.warn parentissue.getReporter()
issue.setAssignee(parentissue.getReporter())
issue.store()
}

@fran garcia gomera  So we have to add this script in the Subtask workflow Create transition right???

I will work around with the script and I’ll do let you know if I have any issues and Thanks you so much for your script.

 

 

Thanks,

kumar

So we have to add this script in the Subtask workflow Create transition right???

Right

Thanks,

you're welcome. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

344 views 1 3
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you