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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

670 views 7 23
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you