Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,362,008
Community Members
 
Community Events
168
Community Groups

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

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

'@Alexey Matveev _Appfire_  : Any help please on ths topic

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Apps & Integrations

Apps for Confluence you won't want to miss: RSVP for September's Appy Hours

Calling all collaborators and Confluence users! Our Appy Hours event on September 29th features 4 presenters demoing functionality to superpower Confluence. Don't miss learning about these apps i...

125 views 0 9
Read article

Atlassian Community Events