Hello,
I'm trying to update some custom fields of a parent issue in a transition of a sub-task workflow. For this, I need to get the parent issue Id from the issue object (of the sub-task).
Unfortunately I couldn't find the REST reference for this. Where is a comprehensive documentation of ScriptRunner Issue Object? Would you please point me to the right method?
Thank you in advance, pj
Dear @Pujan Ziaie,
Firing a GET/ http://128.0.0.1:8080/rest/api/2/issue/ISSUE-6 (this is a sub-task) will also return the information about its parent (JSON response):
{
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
"id": "10500",
"self": "http://128.0.01:8080/rest/api/2/issue/10500",
"key": "ISSUE-6",
"fields": {
"issuetype": {
.
.
.
},
"parent": {
"id": "10200",
"key": "ISSUE-4",
"self": "http://128.0.0.1:8080/rest/api/2/issue/10200",
"fields": {
In this case the parent was ISSUE-4.
Is that what you where looking for?
Hi!
Thanks for the tip! Well I was more looking for something like issue.fields.parent.id or something, so that I won't have to call yet another web service. But if the field is non-existent in the issue object in the post-function, then I guess there is no other way.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear @Pujan Ziaie,
was my answer fine enough to be accepted or do you need more information?
So long
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
Sure it was correct. I was just waiting for a method I could possible call on the issue object to get parent Id to avoid calling a REST function. But now that no one has expressed anything, I guess the method doesn't exist.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.