Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do i get a value from a custom field in SIL

Willyam Mudingayi Malumba December 16, 2024

Here my code i'm trying to acces a customfield value but i'm having an error

string[] parentIssuekeys = linkedIssues(issuekey,"Link",1);

string highestSeverity = "None";

for(string parentIssuekey in parentIssuekeys) {

string parentSeverity = %parentIssuekey%.#{Severity};

}

%issuekey%.#{Severity} = key.#{Severity};

 

1 answer

0 votes
Humashankar VJ
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.
December 17, 2024

Hi @Willyam Mudingayi Malumba 

Seems there are several syntax and logical issues that need to be addressed.

Your code shows a few key problems.

Firstly, SIL requires a specific format (%issuekey%.customfield_xxxx) to access custom fields, and #{Severity} is not a valid reference unless it's been defined as a variable or alias.

Moreover, the syntax used to assign the custom field value is incorrect. Likewise, the initialization of the highestSeverity variable is not utilized, and calculating the highest severity across linked issues requires additional logical operations.

A corrected version of your code is necessary to resolve these issues.

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards

Suggest an answer

Log in or Sign up to answer