Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Products
  • Jira
  • Questions
  • Автоматически установить тему связанной задаче и добавить к ней тему родительской задачи

Автоматически установить тему связанной задаче и добавить к ней тему родительской задачи

Regina Andr November 13, 2023

Как автоматически установить тему связанной задаче и добавить к ней тему родительской задачи

1 answer

1 accepted

1 vote
Answer accepted
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
November 14, 2023

Hi @Regina Andr

The approach you are taking will not work.

If you intend to update the Summary according to the Linked Issue, you must use the Condition field instead of the Additional issue actions field.

I have run a basic test in my environment and got it to work. Below is the sample code that I have tested with:-

import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue

def mutableIssue = issue as MutableIssue

def summary = mutableIssue.outwardLinks.last().destinationObject.summary
def issueManager = ComponentAccessor.issueManager
def loggedInUser = Users.loggedInUser

mutableIssue.setSummary("Example ${summary}")

issueManager.updateIssue(loggedInUser, mutableIssue, EventDispatchOption.DO_NOT_DISPATCH, false)

Please note that the sample code above is not 100% exact to your environment. Hence, you will need to make the required modifications.

Below is a screenshot for your reference:-

image1.png

I hope this helps to solve your question. :-)

Thank you and Kind regards,

Ram

Regina Andr November 15, 2023

Большое спасибо!

Suggest an answer

Log in or Sign up to answer