How to get custom field value using SIL & JIRA cloud and doesn't have Component Manager plug-in?

Carla Dumale November 8, 2018

I want to get the value from other date custom field as a basis to the custom field I am about to add. Please help. Thank you!

2 answers

0 votes
Sami Shaik January 30, 2020

How to get customfield value using SIL?

"From Department" is multi-select custom field, I want to know the script how to get what value is selected in "From Department".

 

 

Regards,

Sami Ahmed Shaik.

0 votes
Alexey Matveev
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 8, 2018

Hello,

You should add a post function with a code like this:

#{custom field name} = #{custom field name};
Carla Dumale November 8, 2018

Thanks! Is there also a way wherein I could get the date when the status is set to closed? I need to stop counting of workdays once the status is closed. 

Carla Dumale November 8, 2018
#{custom field name} = #{custom field name};

You mean i can just add this in my SIL script? Cause I don't think this one works. It causes error. I want to get the value of the custom field "Severity" 

Here is what I wrote:

date PreUAT;
number SLA = Severity;
date startDate = created + "1d";
string startWorkingHour = "09:00";
string endWorkingHour = "18:00";
number[] weekendDays = {7,1};
date [] holidays = {"2018-12-25", "2019-01-01", "2019-02-05", "2019-02-06", "2019-04-19", "2019-05-01", "2019-05-19", "2019-06-05", "2019-08-09", "2019-08-11", "2019-10-27", "2019-12-25"};
number hours = getWorkingInterval(created, currentDate(), startWorkingHour, endWorkingHour, weekendDays, holidays);


if (SLA == 1){
PreUAT = "1d" + startDate;
if (PreUAT < currentDate()){
}
return PreUAT;
}

else if (SLA == 2){
PreUAT = "4d" + startDate;
if (PreUAT < currentDate()){
}
return PreUAT;
}

else if (SLA == 3){
PreUAT = "7d" + startDate;
if (PreUAT < currentDate()){
return PreUAT;
}
}

Alexey Matveev
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 8, 2018

Does your script compile? From what plugin is the Severity field?

Carla Dumale November 8, 2018

Actually I haven't tested it yet. But I changed it to it's custom field id. 

 

date PreUAT;
string[] SLA = "customfield_10056";
date startDate = created + "1d";
string startWorkingHour = "09:00";
string endWorkingHour = "18:00";
number[] weekendDays = {7,1};
date [] holidays = {"2018-12-25", "2019-01-01", "2019-02-05", "2019-02-06", "2019-04-19", "2019-05-01", "2019-05-19", "2019-06-05", "2019-08-09", "2019-08-11", "2019-10-27", "2019-12-25"};
number hours = getWorkingInterval(created, currentDate(), startWorkingHour, endWorkingHour, weekendDays, holidays);


if ("customfield_10056" == "1-Showstopper"){
PreUAT = "1d" + startDate;
if (PreUAT < currentDate()){
}
return PreUAT;
}

else if ("customfield_10056" == "2-Major"){
PreUAT = "4d" + startDate;
if (PreUAT < currentDate()){
}
return PreUAT;
}

else if ("customfield_10056" == "3-Medium"){
PreUAT = "7d" + startDate;
if (PreUAT < currentDate()){
return PreUAT;
}
}

//missing manual input & consider weekends holidays

Carla Dumale November 8, 2018

I'm not sure if I'm doing it correctly. =(

Alexey Matveev
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 8, 2018

Could you test it and say the errors you can see?

Suggest an answer

Log in or Sign up to answer