We have two issue types: Main-task and Sub-Task
After pressing the Workflow-Button "need additional information" of a main-task, the status should switch to "pending" and the create sub-task dialog should open immediately. In the new dialog we want to create a sub-task like "ask john doe for more info"
Question: Is it possible to open the create Sub-Task-Dialog after a Main-Task transition?
Any ideas to solve this behavior?
Hey guys, It seems to work, but whatever parentIssueId I use, the actual parent issue displayed on the dialog is the one being displayed on the view issue screen. If I open the dialog from another screens, no parent issue is displayed on the dialog. How can I set the parentIssueId? Any clues? Thanks
Hi Roger, I am quite new to JIRA myself and have found the only way to execute JS on the page is to embed it in a CustomField description.
So find a customfield that appears on the view screen of the issue in the CustomField section of Issue admin. Edit the CustomField and in the description add your javascript as above. You will want to replace the label "Create New Version" with the label of your transition.
Now when you click on the transition it should open the create-subtask popup.
regards,
Shay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Shay, I am looking to do something similar. I am rather new to Jira, where exactly would you place the JS above?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Olaf,
Thank you for the reply. That is helpful.
I did something similar in the end to resolve the problem, I used some simple JS to find the workflow transition i.e. "Create New Version" and replace the class and the href with those of the actual create-task button.
<script type="text/javascript">
AJS.$(document).ready(function($) {
if (AJS.$("a:contains(Create New Version)")){
var href = AJS.$(".issueaction-create-subtask").attr('href')
AJS.$("a:contains(Create New Version)").addClass("issueaction-create-subtask").attr("href", href);
}
})
</script>
thanks again,
Shay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shay,
our requirement are changed a little bit:
- Execute sub-transition (in background)
- Change the status of the sub-issue
- Show a prefilled create sub-issue dialog
- User can create the sub-issue or cancel the creation process. status is still changed.
- Create a issue link between the first sub-issue (initiator) to the second issue
To solve the above requierments I do a lot of JavaScript-Stuff and deploy this as a plugin.
Some highlights:
- remove/add transtion class from transition-button
$(button).removeClass("issueaction-workflow-transition");
$(button).addClass("issueaction-create-subtask");
- replace current parentId with correct parentId
- replace default click-handler with own click-handler
$(button).unbind("click");
$(button).click(handleOwnClickHandler);
- make rest-call for transtion while create sub-issue dialog is visible
var szURL = AJS.contextPath() + '/rest/ontrack-rest/2.0/workflowservice/performworkflowaction';
var postData = {
"issueId": issueId,
"action": action
};
Maybe this information helps a little bit.
Olaf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Olaf,
Were you able to come up with a solution for this? I am trying to do something similar, where I would like a workflow transition to launch the "ceate Sub-Task" Dialog,
thanks,
Shay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the transition in the workflow, you assign the Sub-task dialog:
You are viewing an active workflow. Create a draft workflow.
Transition View: Create Compliance Action Request
Then, in the post-function of the transition you call a script:
All | Conditions (1) | Validators (0) | Post Functions (6) |
issueObject = issueFactory.getIssue() issueObject.setProjectObject(issue.getProjectObject()) issueObject.setIssueTypeObject(subtaskIssueType ) issueObject.setDescription(issue.getSummary()) issueObject.setReporter(currUser) issueObject.setSummary(issue.getSummary()) issueObject.setDueDate(issue.getDueDate()) issueObject.setPriority(issue.getPriority()) issueObject.setParentObject(issue) //bunch of code here putting the customfields onto the object subtaskIssue = issueManager.createIssueObject(currUser, issueObject)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nancy,
thx for your fast answer, but your solution doesn't work for me.
Reasons:
- The Screen is not the original Create-SubTask Screen. The Subtask-Task-Type picker is missing
- The Screen-Title and Submit-Button Label is not correct
- The entered Attributes in the Subtask-Screen are also persist in the main-task (e.g. summary)
Any other idea?
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.