In my SIL script, I am trying to link an issue but it is not working in my IF statement. Below is the part of my script:
if(contains(customfield_1234,"FieldName"))
{
string newKey = createIssue(key.project, "", "Task", "summary!",priority,"description","",DueDate,"",{},custom_field_mapping);
%newKey%.customfield_1234 = customfield_1234;
linkIssue(key, newKey, "Relates");
}
I think the problem is that it is trying to link an issue that technically doesn't exist since it is wrapped in an IF statement?
Jira log error:
Cannot cast string >>Project_Name<< to an issue. Invalid issue key format. Are you running the script from create screen ?