Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

SIL Script to diplay latest release version of all porjects in one custom field

Ashish February 8, 2021

Hello Community, 

I am trying to diplay the latest Release version of 6 projects in a single custom field using SIL power scrupt . Script is not working . 

Can someone please review and advice .

string [] includedProjects = "LV|LW|LX|LY|LZ";

JVersion updatedVersion = getVersionFromEvent();
string project = updatedVersion.project;//get version from event

//testing from the SIL Manager
//if(isNull(project)) {
//project = "TEST";
//}

//see if project is included
if(arrayElementExists(includedProjects, project)) {
//get all version names from the project
string [] versions = admGetProjectVersions(project);

JVersion latest;

//loop through all version
for(string ver in versions) {
//get all details about the version
JVersion v = admGetProjectVersion(project, ver);

//find the latest released version
if(v.released == true) {
if(isNull(latest.releaseDate)) {
latest = v;
} else if(v.releaseDate > latest.releaseDate) {
latest = v;
}
}
}

//update customfields in the project
if(isNotNull(latest.project)) {
//get all issues in the project
string [] issues = selectIssues("project = " + latest.project);

//loop through the issues
for(string i in issues) {
//update customfield 12345
%i%.customfield_12345 = latest.name
}
}
}

 

Regards
Ashish

1 answer

0 votes
Ashish February 9, 2021

'@Alexey Matveev  : Any help please on ths topic

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events