Hello Team,
In the projects browser page im able to get "last issue update" time for each project.
our requirement is to get this projects in a single page or can this be done using API?
Thanks.
I don't understand what are you trying to get. List of projects that were updated? Every one of them was updated at the certain period of time.
Hello @Damian Wodzinski ,
Sorry for the confusion.
We want to get the last issue updated date of each project.
It will be hard. You can write a script that is running trough all projects and is comparing the data of the last updated ones. Or if you can somehow order Issues in project by Updated Time and grab the newest one, this would be easier. But I do not have a ready script for that.
I had a similar need and ended up writing a script that queries the Jira API for every project key. You can use the query below to get the most recent issue update for a project with key "PROJ" for example. It will return 1 result with only the "updated" date field of the most recently touched Jira issue for that project.
<your.jira.site>/rest/api/2/search?jql=project=PROJ+ORDER+BY+updated+DESC&maxResults=1&fields=updated
Hi Mark,
Can you please help me with the script. I am also looking for such kind of stuff.
I was trying to create an export file of Projects with the same thing @Yuvi was asking for, the Last issue update column that is visible in the UI.
I found my answer with Optimizer for Jira. It allows you to add the "Last issue update" column to its listing of Projects, and then export that list as CSV.
@Darryl Lee
I have DC and was wondering, when you say it allowed you to add the column to its listing of projects and then export that list as CSV, does it add an export feature in the System --> Projects section or does it open up the option to add the column in Issue Navigator to somehow pull projects by last issue update?
Right now, I have the column when I go to see all my projects in my instance but have no way to export the list so am curious. I don't have a solid way via Issue Navigator to narrow down by project versus issues so trying to get a better understanding whether this may meet our needs.
Optimizer has its own separate UI and section in Jira to display Projects and other various Jira objects that it can help you optimize.
As pictured below, their UI has the additional "Last Updated" column along with an export to CSV option.
A heads-up though: The trial license limits you to viewing/exporting only 25 projects. (I assume the vendor got tired of people "trying their app for free" and then after gathering the necessary info, not purchasing.)
It is indeed disappointing that that column is visible on the standard Jira manage projects screen, but not exportable. Perhaps I could script something to scrape those pages...
BAH, so much for my scraping idea. I went and did an acli renderRequest for 7 pages of Projects and it was all for naught.
Friggafragging dynamically loading Javascript grrrrr....
(Oh how I long for the olden days of simple server-side apps that are easily scrapeable as HTML.)
Hi
This is a scriptrunner solution
/*****************************************Tom Lister 2021******************************************/import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.project.Projectimport com.atlassian.jira.project.ProjectManagerimport org.apache.log4j.Loggerimport com.atlassian.jira.user.ApplicationUserimport com.atlassian.crowd.embedded.api.Userimport com.atlassian.jira.issue.IssueManager;import com.atlassian.jira.bc.issue.search.SearchService import com.atlassian.jira.web.bean.PagerFilterimport com.atlassian.jira.issue.Issuedef logit = Logger.getLogger("com.cheil.eu.logging")ProjectManager pMgr = ComponentAccessor.getProjectManager()SearchService searchService = ComponentAccessor.getComponent(SearchService.class)ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()String[] categories= [ "Deutsch"]logit.info("Project Key,Project Name,Category,Lead,Issues,Updated")categories.each() {String category ->def p6 = pMgr.getProjectCategoryObjectByName(category)def proj = pMgr.getProjectObjectsFromProjectCategory(p6.getId())proj.each() {Project p ->def cat = p.getProjectCategory()def lastUpdatedef earliestUpdatedef issueCount = 0String jqlSearch = 'project=' + p.getKey() + ' ORDER BY updated DESC'SearchService.ParseResult parseResult = searchService.parseQuery(user, jqlSearch)if (parseResult.isValid()) {def searchResult = searchService.search(user, parseResult.getQuery(), PagerFilter.getUnlimitedFilter())if (searchResult.getResults().size() > 0) {issueCount = searchResult.getResults().size()Issue issue = searchResult.getResults().first() if (issue) {lastUpdate = issue.getUpdated()}}}jqlSearch = 'project=' + p.getKey() + ' ORDER BY updated ASC'parseResult = searchService.parseQuery(user, jqlSearch)if (parseResult.isValid()) {def searchResult = searchService.search(user, parseResult.getQuery(), PagerFilter.getUnlimitedFilter())if (searchResult.getResults().size() > 0) {Issue issue = searchResult.getResults().first() if (issue) {earliestUpdate = issue.getUpdated()}}}//def categoryif (!cat) {category = "none"} else { category = cat.getName()}logit.info(p.getKey() + "," + p.getName() + "," + category + "," + p.getLead().getDisplayName() + "," + issueCount + "," + lastUpdate + "," + earliestUpdate)//p.getLead()}}logit.info("Project Key,Project Name,Category,Lead,Issues,Updated")
Here is an powershell example:
This just gets the date
$Headers = [Logon info]$JiraServer = [Jira Server URL]$ProjectKey =[Project Key]$HTTPData = Invoke-WebRequest -Uri "$JiraServer/rest/api/2/search?jql=project=$ProjectKey+ORDER+BY+updated+DESC&maxResults=1&fields=updated" -Headers $Headers$ProjectIssues = $HTTPData.Content | ConvertFrom-Json$LastIssueUpdate = $ProjectIssues.issues.fields.updated.Split("T")[0]
Hi @Tom Lister
Looking at the script I assume this was for a server instance. Do you know what the cloud equivalent is?
Dan
It looks like you're new here. Sign in or register to get started.