Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

I get problem in my customer listener

Ernest
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!
June 20, 2024

The problem is: 

 

2024-06-20 17:36:39,703 ERROR [runner.AbstractScriptListener]: ************************************************************************************* 2024-06-20 17:36:39,703 ERROR [runner.AbstractScriptListener]: Script function failed on event: com.atlassian.jira.event.issue.IssueEvent, file: null com.adaptavist.hapi.jira.issues.exceptions.IssueUpdateValidationException: The following errors occurred: (issuetype=Запрос имеет тип под-задачи, но родительский Запрос или идентификатор не определен.) at com.adaptavist.hapi.jira.issues.implementation.IssuesImplementation.update(IssuesImplementation.groovy:189) at com.adaptavist.hapi.jira.extensions.IssueExtensions.update(IssueExtensions.java:67) at Script66.run(Script66.groovy:32)

 

I just try to update a field value for subtask on assigned event. Script works when issue updated with new assignee but doesn't work when issue created with first assignee

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Putri Nur Dayana Kamarudin June 20, 2024

Hi Ernest! Based on the rough translation of the error, it means that the parent ID is missing for the task, so you must specify them during issue creation.

An example in this ScriptRunner documentation might be helpful for you : https://docs.adaptavist.com/sr4js/latest/hapi/create-issues#:~:text=Creating%20a%20subtask,specify%20the%20subtask%20issue%20type

If you're running this script from a listener, you will need to specify the parent issue first with like the example below :

def issue = event.getIssue()

issue.createSubTask('Sub-task') {
setAssignee('robot')
setSummary("test")
}

 Hope this helps!

0 votes
Dave Rosenlund _Trundl_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 20, 2024

Welcome to the community, @Ernest 👋

Your question is related to Scriptunner, an Atlassian Marketplace app from Adaptavist, so I moved your question here to App Central, which is the best place for questions related to marketplace add-ons. 

In my experience, you may get faster service from marketplace partners by contacting their support team directly

If you choose that course, please come back and update this thread with the solution.

Good luck,

-dave

TAGS
AUG Leaders

Atlassian Community Events