Hello.
I'm struggling with a weird problem with SIL custom field.
What I'm trying to do is to copy links from parent right away on creation of subtask. However the tricky part is I want to copy only the links to issues with creation date after some date set in the customfield.
Here is my code:
string[] mlinked_issues = linkedIssues(parent);
string mthis_key = key;
string mlink_key;
string mindex = size(mlinked_issues);
for(number i=0; i<=mindex; i=i+1)
{
mlink_key = mlinked_issues[i];
logPrint("ERROR", "KEY: " + mlink_key + "--------- if(" + %mlink_key%.created + " >= " + %mthis_key%.customfield_10900 + ");");
if (%mlink_key%.created >= %mthis_key%.customfield_10900)
{
logPrint("ERROR", "I'm inside IF statement!");
linkIssue(key, mlink_key, "Relates");
}
}
What is weird about it: earlier I have had the script without "if" statement and it worked perfectly copying ALL links from parent. Now, when I added "if" statement, it is still copying all links even though it is NOT entering the "if" statement. I even removed completely the "linkIssue" command... and it still copy all links from parent. Don't ask me how, I am completely confused.
Logs show that it shouldn't enter the "if" statement as well as some errors:
2013-08-14 17:26:55,034 ajp-bio-8009-exec-3 ERROR ***user_login*** 1046x30461x1 3uqcia ***user_IP*** /browse/ITEM-709 [commons.sil.routines.LogPrintRoutine] KEY: DOK-792--------- if(2013-08-07 14:01:00 >= 2013-08-14 17:13:40);
2013-08-14 17:26:55,040 ajp-bio-8009-exec-3 ERROR ***user_login*** 1046x30461x1 3uqcia ***user_IP*** /browse/ITEM-709 [commons.sil.routines.LogPrintRoutine] KEY: DOK-793--------- if(2013-08-12 14:09:51 >= 2013-08-14 17:13:40);
2013-08-14 17:26:55,047 ajp-bio-8009-exec-3 ERROR ***user_login*** 1046x30461x1 3uqcia ***user_IP*** /browse/ITEM-709 [commons.sil.routines.LogPrintRoutine] KEY: DOK-795--------- if(2013-08-14 11:46:51 >= 2013-08-14 17:13:40);
2013-08-14 17:26:55,053 ajp-bio-8009-exec-3 ERROR ***user_login*** 1046x30461x1 3uqcia ***user_IP*** /browse/ITEM-709 [commons.sil.routines.LogPrintRoutine] KEY: DOK-796--------- if(2013-08-14 11:47:04 >= 2013-08-14 17:13:40);
2013-08-14 17:26:55,059 ajp-bio-8009-exec-3 ERROR ***user_login*** 1046x30461x1 3uqcia ***user_IP*** /browse/ITEM-709 [commons.sil.routines.LogPrintRoutine] KEY: DOK-797--------- if(2013-08-14 11:47:14 >= 2013-08-14 17:13:40);
2013-08-14 17:26:55,064 ajp-bio-8009-exec-3 ERROR ***user_login*** 1046x30461x1 3uqcia ***user_IP*** /browse/ITEM-709 [jira.commons.ivm.IssueVariable] Variable >>.created<< is not a custom field.
2013-08-14 17:26:55,064 ajp-bio-8009-exec-3 ERROR ***user_login*** 1046x30461x1 3uqcia ***user_IP*** /browse/ITEM-709 [jira.commons.sil.SILUtils] [SIL Error on line: 10, column: 63] Variable >>.created<< is not a custom field.
2013-08-14 17:26:55,064 ajp-bio-8009-exec-3 ERROR ***user_login*** 1046x30461x1 3uqcia ***user_IP*** /browse/ITEM-709 [jira.commons.silrunner.UnifiedSilRunner] Exception while executing SIL program >>SilScript custom field Default Configuration for SIL - Kopiowanie linkow<<
com.keplerrominfo.jira.commons.sil.SILInfoException: [SIL Error on line: 10, column: 63] Variable >>.created<< is not a custom field.
(...)
Caused by: com.keplerrominfo.jira.commons.sil.SILException: Variable >>.created<< is not a custom field.
(...)
2013-08-14 17:26:55,067 ajp-bio-8009-exec-3 ERROR ***user_login*** 1046x30461x1 3uqcia ***user_IP*** /browse/ITEM-709 [plugins.keplercf.silscriptcf.SilScriptCFType] Exception occurred while executing SIL Script for custom field Default Configuration for SIL - Kopiowanie linkow on issue ITEM-709
com.keplerrominfo.jira.commons.sil.SILException: Exception while executing SIL program >>SilScript custom field Default Configuration for SIL - Kopiowanie linkow<<
(...)
Caused by: com.keplerrominfo.jira.commons.sil.SILInfoException: [SIL Error on line: 10, column: 63] Variable >>.created<< is not a custom field.
(...)
Caused by: com.keplerrominfo.jira.commons.sil.SILException: Variable >>.created<< is not a custom field.
(...)
I will appreciate any help on this issue. I'm quite new to using SIL, and probably I'm making some newbie mistakes, yet I can't find them for more than 6 hours already...