Hi,
I'm looking to try and add multiple sub tasks when I transition between two status
The idea is that the I have a custom group field where and sub tasks will be created for all the groups in the custom field.
For example , Group1, Group2, and Group3 are selected in custom field then, 3 approval sub tasks are created.
heres what I've got so far
//add comment
addComment(key, currentUser(), "Peer Review Approved");
// change approvers are here
string[] issue_approvers = customfield_10072;
// Create Change Approval Sub-tasks
string issue_project = Project;
string issue_parent_key = key;
string issue_type = "Approval";
string issue_summary = "Approval Task for " +issue_approvers ;
string issue_priority = "";
string issue_description = "Before Approving please ensure you happy with change documentation";
string[] issue_components;
date issue_dueDate = "";
string issue_security_level;
string[] issue_fields_mapping;
// loop for approver groups in custom field
for (string issue in issue_approvers) {
//ensure all fields added to task screen
string i = createIssue(issue_project, issue_parent_key, issue_type, issue_summary, issue_priority, issue_description,
issue_components, issue_dueDate, issue_security_level, issue_fields_mapping);
}
Hello,
Is it not working?
no, It was working when just adding one task without the for loop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe the for loop is not executed?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, so if i take the string issue_approver out and remove the for loop it will create one approval task
//add comment
addComment(key, currentUser(), "Peer Review Approved");
// change approvers are here
//string[] issue_approvers = customfield_10072;
// Create Change Approval Sub-tasks
string issue_project = Project;
string issue_parent_key = key;
string issue_type = "Approval";
string issue_summary = "Approval Task for " +key;
string issue_priority = "";
string issue_description = "Before Approving please ensure you happy with change documentation";
string[] issue_components;
date issue_dueDate = "";
string issue_security_level;
string[] issue_fields_mapping;
// loop for approver groups in custom field
//for (string issue in issue_approvers) {
//ensure all fields added to task screen
string i = createIssue(issue_project, issue_parent_key, issue_type, issue_summary, issue_priority, issue_description,
issue_components, issue_dueDate, issue_security_level, issue_fields_mapping);
//}
// add reviewer custom field as assignee on new task
//%i%.assignee = %issue_parent_key%.assignee;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is why I think that the for loop is never executed. Are you sure that issue_approvers has a value?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, I checked that. The field is also added to the task just in case that had something to do with it.
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.