Hi ,
I want to implement that when parent task dudate has changed the sub-task duedate change to blank. Can anyone help me. I want to use sil scrpt to implement it.
Thanks,
Mandia
Hello,
Your code would be like this:
JFieldChange [] changes = lastIssueChanges(key);
boolean flag = false;
for(number i = 0; i < size(changes); i++) {
if (changes[i].field == "duedate") {
flag = true;
}
}
if (flag) {
string [] subtaskArray = subtasks(key);
for (string subKey in subtaskArray) {
%subKey%.dueDate = "";
}
}
if("Task" == issueType)
{
JFieldChange [] changes = lastIssueChanges(key);
boolean flag = false;
for(number i = 0; i < size(changes); i++)
{
if (changes[i].field == dueDate)
{
flag = true;
}
}
if (flag)
{
string [] subtaskArray = subtasks(key);
for (string subKey in subtaskArray)
{
if(%subKey%.status != "Closed" && %subKey%.status != "Cancelled")
{
%subKey%.dueDate = "";
}
}
}
}
I have updated my code but it doesn't work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should change:
if (changes[i].field == dueDate)
to
if (changes[i].field == "duedate") {
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have updated my code, but it still doesn't work. I find a issue. When I update other fields in parent task, the subtask due date will auto change.
Thanks,
Mandia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if("Task" == issueType)
{
JFieldChange [] changes = getFieldChanges(key,"Due Date");
boolean change = false;
for(number i = 0; i < size(changes); i++)
{
if (changes[i].field == "Due Date" && changes[i].oldVal != changes[i].newVal )
{
change = true;
}
}
if (change)
{
string [] subtaskArray = subtasks(key);
for (string subKey in subtaskArray)
{
if(%subKey%.status != "Closed" && %subKey%.status != "Cancelled")
{
%subKey%.dueDate = "";
}
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mandia the DueDate field is not updated automatically. It means you have a script somewhere , which updates the Due Date field. You should find 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.