Is there way to check - if an issue is a subtask, and if it is - get link(key, id) to parent issue?
In REST API client(jira-rest-java-client-0.6-m2.jar) and in SOAP API client(jira-soap-5.0.0.jar) i didn't find such methods.
Maybe i missed something? How to operate this?
Community moderators have prevented the ability to post new answers.
Issue iss2 = getRestClient().getIssueClient().getIssue(task.getKey(), new NullProgressMonitor()); Field ob = iss2.getField("parent"); if (ob!=null){ JSONObject jsonParent = (JSONObject)ob.getValue(); BasicIssue bi = null; try { bi = new BasicIssueJsonParser().parse(jsonParent); } catch (JSONException e1) { e1.printStackTrace(); } System.out.println("parrent: Parced key: "+bi.getKey()); }else{ System.out.println("parrent: no parent found"); }
I'm not sure what you're using to retrieve data, but if I use a CURL request via PowerShell:
$Array = .\curl.exe https://host.jira.com/rest/api/latest/issue/[Issuekey]
Convert the response from JSON
then examine $Array.fields.issuetype.subtask and look for a TRUE value...and it's a subtask.
$Array.fields.parent.key holds the parent issue.
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.