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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So we have to add this script in the Subtask workflow Create transition right???
Right
Thanks,
you're welcome.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.