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
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
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.