Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

set up a specific form through the customer portal based on multiple conditions

Synngul November 29, 2020

As I’m currently working for an IT Canadian company as JIRA administrator, I tried to set a specific form through our customer portal with some conditions but it doesn’t work for some reason, I tried to look for support but I didn’t know who to speak with.

So to make it clear, I’m currently using the sil to make it happen. I have both init.sil script run from the Live Field and hook.sil script.

Actually, I have three custom fields identified by their ID: company, project and subsidiary

Company: select list (single choice)
Project: checkboxes (I tried to use the select list with multiple choices before but it didn’t work)
Subsidiary: free form text (single line)

The idea is simple: when a user is filling the form through a portal, he has all the custom fields hidden at the beginning except the one for company, then when he selects a company, the project custom field appears and he has items restrictions based on the value of the first custom field (company). For a specific company and a specific project, he has the third custom field subsidiary appearing.

Everytime he comes back to default value from the company field (none), the project field and the subsidiary field are hidden again.

This would work for both creating and editing screens only.
The view screen should only display the information we entered from the custom fields.

Could you help me out please?
Thank you in advance.

init.sil:

if (argv["screen"] == "create" || argv["screen"] == "edit")
{
lfWatch("customfield_16798", "customfield_16798", "/temp_jira/atlassian/application-data/jira/silprograms/TEST/Custom-cascading-select-field/test2.sil", {"change"});
lfWatch("customfield_16797", {"customfield_16798", "customfield_16797"}, "/temp_jira/atlassian/application-data/jira/silprograms/TEST/Custom-cascading-select-field/test2.sil", {"change"});
}

hook.sil:

string v = argv["customfield_16798"];

if (v == "Groupe Optimum")
{
lfShow("customfield_16797");
lfShow("customfield_16799");

lfAllowSelectOptions("customfield_16797", {"Financiers"});
if (contains(argv["customfield_16797"], "Financiers"))
{
lfShow("customfield_16799"); // Indiquer la Filiale
lfSet("customfield_16799", "oui c'est bon");
}
}
else if (v == "INF")
{
lfShow("customfield_16797");
lfHide("customfield_16799");
lfSet("customfield_16799","");
lfAllowSelectOptions("customfield_16797", {"Confluence", "JIRA"});
}
else if (v == "OGI")
{
lfShow("customfield_16797");
lfHide("customfield_16799");
lfSet("customfield_16799","");
lfAllowSelectOptions("customfield_16797", {"PolicyCenter", "Syncra Claims", "Syncra Polices Habitations", "Polices Automobiles", "Polices Commerciales"});
}
else if (v == "ORE")
{
lfShow("customfield_16797");
lfHide("customfield_16799");
lfSet("customfield_16799","");
lfAllowSelectOptions("customfield_16797", {"DAVE", "GRP2"});
}
else
{
lfHide("customfield_16797");
lfHide("customfield_16799");
lfSet("customfield_16797","");
lfSet("customfield_16799","");
}

 

I also tried something easier with the swtich statement:

string v = argv["customfield_16798"];

switch (v)
{
case "Groupe Optimum":
lfShow("customfield_16797");
lfAllowSelectOptions("customfield_16797", "Financiers");
if (contains(argv["customfield_16797"], "Financiers"))
{
// argv["customfield_16799"] = "oui c'est bon";
}
break;
case "INF":
lfShow("customfield_16797");
lfAllowSelectOptions("customfield_16797", {"Confluence", "JIRA"});
break;
case "OGI":
lfShow("customfield_16797");
lfAllowSelectOptions("customfield_16797", {"PolicyCenter", "Syncra Claims", "Syncra Polices Habitations", "Polices Automobiles", "Polices Commerciales"});
break;
case "ORE":
lfShow("customfield_16797");
lfAllowSelectOptions("customfield_16797", {"DAVE", "GRP2"});
break;
default:
// lfHide("customfield_16797");
// lfHide("customfield_11997");
break;
}

1 comment

Peter Preston
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2020

Hi @Synngul,

An app like ProForma Lite (free for up to three forms) could help you set this up quickly. You can setup conditional logic based on question type and answer so that your users are presented with the right questions and choices each time.

Here's an example of what that can look like:

Screen Recording 2020-11-30 at 12.10.17.gif

You are able to link ProForma fields to Jira fields, but it's not necessary and can help you cut down on the number of custom fields required.


Full transparency, I'm on the ProForma team, but thought this might be helpful for you.

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events