Parent ABC-546
1st Subtask key ABC-546-01
2nd Subtask key ABC-546-02
3rd Subtask key ABC-546-03
etc.
Hi @Mary Kelly
Work item keys are automatically assigned by Jira in the format "ProjectKey-NNNN" where NNNN is an incrementing number for each project.
There is no way to set up the work item key in the format you've asked about ie. "ParentKey-NN"
The simplest way to be able to view subtask keys would be to put "ParentKey-NN" at the start of the Summary for the subtask.
This can be achieved by automation if you were to have a consistent set of subtasks for the parent story that would all have recurring summaries, e.g.
But if this is not the case then manually adding this when you create the subtask will be the easiest solution.
Hi @Mary Kelly
Yes this can be possible through REST API
Example:
IssueInputBuilder issueBuilder = new IssueInputBuilder("Project1", 5L);//5 is the id for subtask type. You can know the id of subtask type by querying this REST api /rest/api/2/issue/createmeta
issueBuilder.setDescription(">> Test Description");
issueBuilder.setSummary("Test summary");
issueBuilder.setProjectKey("Project1");
Map<String, Object> parent = new HashMap<String, Object>();
parent.put("key", "SOMEISSUE-234");
FieldInput parentField = new FieldInput("parent", new ComplexIssueInputFieldValue(parent));
Map<String, Object> customField = new HashMap<String, Object>();
customField.put("value", "someValue");//This is some custom field value on the subtask
customField.put("id", "12345");//This is the id of the custom field. You can know this by calling REST GET for a manually created sub-task
issueBuilder.setFieldInput(parentField);
issueBuilder.setFieldValue("customfield_12345", new ComplexIssueInputFieldValue(customField));//here again you have to query an existing subtask to know the "customfield_*" value
com.atlassian.jira.rest.client.domain.input.IssueInput issueInput = issueBuilder.build();
BasicIssue bIssue = restClient.getIssueClient().createIssue(issueInput, pm);
System.out.println(">>> " + bIssue.getKey());
to get it to associate with the parent story. the setFieldInput to parent seemed to do it
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mary Kelly
@Stephen_Lugton is right; there is no control over the issue key (at least on the cloud), and they get auto-generated.
The best option is to have the desired (incremental) key in the Summary of the newly created issue.
We at appbox allow you to create child issues using your own AI Prompts. This can simplify this task, and you can command the AI to create child issues in the desired format; please see the example demo below.
Demo - https://youtu.be/qtntxU7fiwY
Marketplace App - https://marketplace.atlassian.com/apps/1236275/ai-agents-for-jira-enterprise?hosting=cloud&tab=overview
Let us know if you have any questions.
Team,
Appbox AI
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online 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.