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

Jira SIL Script - How do we get the projects which are modified today

Purushothama KOTEKAN YOGENDRAPPA
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 28, 2024

Hello,

I'm quite new to Jira and SIL, and I have a requirement to get only those projects which are updated recently (for example today)

I can get the result using the advanced search with the below query in GUI:

type = Project AND updated >= startOfDay()

However, I am not sure how to get this translated to SIL language as the method  

allProjects() doesn't accept any parameter to pass to query.

It would be appreciated if you could tell us if there are any other alternative approaches for this problem 

3 answers

Suggest an answer

Log in or Sign up to answer
1 vote
Anna Hryhoruk _Appfire_
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.
July 1, 2024

Hello @Purushothama KOTEKAN YOGENDRAPPA 

In case you wish to get a project list based on the issues that were created today or not, I have some sample script for you. This script tracks the most recent issue updates across all Jira projects. It outputs each project's latest update date and identifies which projects have issues updates on the current date. Also, pay attention that lastIssueChanges(issue) This does not include adding new Comments. If necessary, I think it may be added, but in a slightly different way. 

date today = currentDate();
string todayStr = formatDate(today, "yyyy-MM-dd");
string [] prj_updated_today;

for (string p in allProjects()) {
runnerLog("project: " + p);

string [] issues = selectIssues("project = " + p + " ");
date [] ChangeDate;

for (string issue in issues) {
JFieldChange [] changes = lastIssueChanges(issue);

for (number i = 0; i < size(changes); i++) {
ChangeDate += changes[i].changeDate;
}
}

// Find the most recent date in ChangeDate array
date LastChangeDate = ChangeDate[0];

for (number j = 1; j < size(ChangeDate); j++) {
if (ChangeDate[j] > LastChangeDate) {
LastChangeDate = ChangeDate[j];
}
}

// Format the LastChangeDate to include only year, month, and day
string formattedDate = formatDate(LastChangeDate, "yyyy-MM-dd");

runnerLog("Last Update Date: " + formattedDate);

// Check if formattedDate matches today's date
if (formattedDate == todayStr) {
prj_updated_today += p;
}
}

runnerLog("Projects updated today: " + prj_updated_today);

This is one approach. Another is to create JQL that searches for the most recent update date and run it via sil; another may be to run an SQL query over the Jira database.

Hope this matches your use case. 

Best regards,
Anna

0 votes
Sayed Bares _ServiceRocket_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 28, 2024

@Purushothama KOTEKAN YOGENDRAPPA Welcome to the community!

if you want to get the result of your JQL (advanced search) in SIL then you should use the selectIssues function. However, I don't think there is a function for you to get the list of last updated projects. I would suggest reaching out to the Appfire support to get more info.

0 votes
Dave Rosenlund
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 28, 2024

Hi, @Purushothama KOTEKAN YOGENDRAPPA   👋  And welcome to the community.

I moved your question to App Central, where questions about Atlassian Marketplace products, like SIL, should be posted. Also, I added additional tags to hopefully draw the right eyeballs to your post.

 

That said, you may want to contact the Appfire support team directly for a faster response time and resolution.

Best of luck,

-dave

P.S.  If you do contact Appfire, it would be great if you'd come back and share the solution here so others can benefit in the future.

TAGS
AUG Leaders

Atlassian Community Events