I'm getting the following showing up in my atlassian-JIRA log:
2016-08-01 15:08:56,947 ajp-nio-8009-exec-33 WARN username 908x317210x1 2x5orf ipaddress /rest/keplerrominfo/jjupin/latest/lf/instantHook [c.k.j.p.j.ui.livevalidator.LiveFieldRestService] Sil exception when executing script. at com.keplerrominfo.jira.plugins.jjupin.ui.livevalidator.LiveFieldRestService.executeHook(LiveFieldRestService.java:248) at com.keplerrominfo.jira.plugins.jjupin.ui.livevalidator.LiveFieldRestService.executeHooks(LiveFieldRestService.java:231) at com.keplerrominfo.jira.plugins.jjupin.ui.livevalidator.LiveFieldRestService.onInstantWatch(LiveFieldRestService.java:212) at com.keplerrominfo.jira.plugins.jjupin.ui.livevalidator.LiveFieldRestService.executeHook(LiveFieldRestService.java:248) at com.keplerrominfo.jira.plugins.jjupin.ui.livevalidator.LiveFieldRestService.executeHooks(LiveFieldRestService.java:231) at com.keplerrominfo.jira.plugins.jjupin.ui.livevalidator.LiveFieldRestService.onInstantWatch(LiveFieldRestService.java:212)
It unfortunately doesn't list the specific SIL script that is failing, so I can't figure out what's causing the error. I've listed the three Live Field scripts I'm using below - perhaps someone could take a look and see if they see anything that might be causing the error?
First Script:
if (!contains(argv["screen"], "create")) { if( (issueType == "Circuits" || issueType == "CSA - Add/Mod" || issueType == "Cut Sheet Sub-Task" || issueType == "Hardware Sub-Task" || issueType == "LNP DID Order" || issueType == "LNP Port Request" || issueType == "Prov Sub-Task" || issueType == "Sub-task" || issueType == "Technical task" || issueType == "Training") && assignee != currentUser()) { lfDisable("dueDate"); } }
Second Script:
lfInstantHook({"project", "issueType"}, "CreateScreenLiveFields.sil"); lfWatch("issueType", {"issueType", "project"}, "CreateScreenLiveFields.sil"); lfWatch("project", {"issueType", "project"}, "CreateScreenLiveFields.sil"); //Wasn't sure which of these were necessary
CreateScreenLiveFields.sil is:
if (argv["screen"] == "create" and contains(argv["project"], "Infrastructure Change Request")) { lfRestrictSelectOptions("issueType", {"Standard Change Request","MAINT JIRA"}, true); } if(argv["screen"] == "create" && contains(argv["project"], "Salesforce Platform") && argv["issueType"] == "Bug") { //on Create Issue screen lfSet("description", "[Please fill in information requested in this description template] \n\n" + "Description of Problem: \n\n" + "List of Steps To Reproduce the Problem: \n" + "1. \n" + "2. \n" + "etc ... \n \n" + "Expected Results: \n\n" + "Actual Results: \n\n" + "Data Used: \n" + "-Userid: \n" + "-Fields: \n" + "etc ... \n\n" + "Reproducible: (Yes/No) ( if Yes, describe frequency of occurrence e.g. 8 out of 10 attempts) \n\n" + "Screenshots or video Attached (Yes/No): \n"); lfShowFieldMessage("description", "Description Template Automatically Populated. Please fill in information requested", "INFO"); } if(argv["screen"] == "create" && contains(argv["project"], "Salesforce Platform") && argv["issueType"] == "Story") { //on Create Issue screen lfSet("description", "[Please fill in information requested in this description template] \n\n" + "Requestor: \n\n" + "Details of Request: \n" + "* (e.g. Report affected, new field, new users,...) \n\n\n" + "Business Rationale: \n" + "* (Note: new user accounts have a real world dollar cost! and an email should be attached indicating managerial support for the request) \n\n\n" + "Impact: \n\n\n" + "Screenshots attached if applicable: (Yes/No): \n\n\n" + "Implementation Note about Validation: \n"); lfShowFieldMessage("description", "Description Template Automatically Populated. Please fill in information requested", "INFO"); } if (contains(argv["project"], "Salesforce Platform")) { lfRestrictSelectOptions("issueType", "Offboarding", true); } if(argv["screen"] == "create" && (contains(argv["project"], "Portal") || contains(argv["project"], "Automation") || contains(argv["project"], "HUB")) && argv["issueType"] == "Bug") { //on Create Issue screen lfSet("description", "*Steps to Reproduce* \n\n" + "# \n# \n# \n\n" + "*Expected Results* \n\n" + "Expected to see\n\n" + "*Actual Results*\n\n" + "Actually saw that\n\n"); lfShowFieldMessage("description", "Description Template Automatically Populated. Please fill in information requested", "INFO"); } if(argv["screen"] == "create" && (contains(argv["project"], "Portal") || contains(argv["project"], "Automation") || contains(argv["project"], "HUB")) && argv["issueType"] == "Story") { //on Create Issue screen lfSet("description", "*Acceptance Criteria* \n\n" + "* \n* \n* \n"); lfShowFieldMessage("description", "Description Template Automatically Populated. Please fill in information requested", "INFO"); } if(argv["screen"] == "create" && contains(argv["project"], "Onboarding and Offboarding") && argv["issueType"] == "Offboarding") { lfSet("summary", "New Termination Request"); }
Third Script is simply:
lfRestrictSelectOptions("issueType", "Offboarding", true);
Any help would be great!
Hi Samip,
Are you running the script on create screen? If so, try to replace your if with
if argv["issueType"] == "Change Request"
Hope this helps,
Alexandra
I am facing the similar problem... from the log I see this error...
Script is not running in the context of an issue.Cannot get value for field issueType
Below is my script...
if(issueType== "Change Request")
{
//////////////////////////////////////////////////////////////////////////////////////////////////
// For CR Live Field check
//////////////////////////////////////////////////////////////////////////////////////////////////
lfWatch("summary", {"summary","issueType"}, "CR_ResetApprovalHookScript.sil", {"change"});
lfWatch("description", {"description","issueType"}, "CR_ResetApprovalHookScript.sil", {"change"});
}
i only want to run the "CR_ResetApprovalHookScript.sil" code if the issuetpye is "Change Request" rest I don't want to do anything.
Is this a right way to do it? if not what is right way to achieve the behavior.
Thanks in advance.
~Samip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sil exception when executing script.
Can you share the root cause for it? It's there, on the full stacktrace.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Found it: Script is not running in the context of an issue.Cannot get value for field key
I added: if (!contains(argv["screen"], "create"))
to the script generating the issue - is there anywhere else that a Live Fields script could be running that wouldn't be in the context of an issue? If so, how should I edit the script to ensure it doesn't run there?
Thanks for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nope, only the create screen needs that. In general, people forget that on LF there's no issue until it is saved.
Have fun.
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.
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.