@ianRagudo once concern I have with this approach: Would this only show contributions by the last editor? In other words, if two people edited the same page, it seems only the last editor would show up in the API. Is there a way to see that both people edited within a particular time period? In my use case, I would like to see all pages edited by a particular individual within a particular time period (say last March) regardless of whether they were the creator or if someone else subsequently edited the page. Is there a way to do that in the API?
Welcome to the Atlassian Developer Community, @alok!
As your question, although related, is a different use case to that of the original post, I moved your question to a new topic.
The CQL needs to be modified to achieve what you want. You can try something like
/wiki/rest/api/content/search?cql=type in (page,blogpost) and contributor = "{accountId}" and lastmodified >= {startDate in yyyy-mm-dd} and lastmodified < {endDate in yyyy-mm-dd}
If you want to search for more content created or edited by more than one user, you can use contributor IN ("{accountId1}", "{accountId2}",...)
.
For more information about CQL fields, kindly check this reference.
Hope this helps.
Ian
Hi @ianRagudo! I had another idea: the recent activity plugin nearly has what I want, the only problem is that it returns a fragment of HTML:
https://<server_domain>/plugins/recently-updated/changes.action?theme=sidebar&pageSize=10&startIndex=0&authors=&spaceKeys=*&contentType=,page,comment,blogpost,attachment,userinfo,spacedesc,personalspacedesc,space,draft,custom
Is there some parameter I can pass (perhaps for “theme”) that will cause it to return JSON instead of HTML? Thanks!
Hello,
I used the recommended approach but noticed some results had disappeared.
My query is:
/rest/api/content/search?cql=contributor+=+'%s'+and+lastmodified+%%3E=+'%s'+and+lastmodified+%%3C+'%s'
this query returned different results for the same user and period from 2024-08-12 to 2024-08-18.
A modified page disappeared from the results. I believe this happened because the user initially updated the page within the specified period, so it appeared in the list. However, the user modified the page again, and the lastmodified date changed, which now falls outside the original period.
@ianRagudo Is it logical?
Do you know how I can get constant results whenever the query is done?
Welcome to the Atlassian Developer Community, @SerhiiTanchenko!
Regarding your question, since you are using the lastmodified
CQL field, the results will never be constant since the lastmodified
value can change when a page is updated.