I am using Python and Jira REST APIs to get all the issues logged against a project and the worklogs corresponding to the issue
/rest/api/3/search
payload_dict['expand'] = []
payload_dict['jql'] = "project = TEST AND updated > '2020-01-01 00:00'"
field_list = [
"issuekey",
"issuetype",
"issuelinks",
"worklog"
]
payload_dict['maxResults'] = 100
When the worklog object is returned, i am getting below json object inside issues.fields.worklog. Since i am not getting the next Url for this nested worklog object, i am not sure how do i get remaining objects of the worklog, if it has more than 20.
Any suggestions will be helpful.
{
"startAt": 0,
"maxResults": 20,
"total": 200,
"worklogs": [
{
.
.
}
]
Hi @Vishal Biyani ,
I would recommend you to use issue search endpoint for getting only list of issues and then Get issue worklog endpoint for getting worklogs for each found issue. There are query parameters like startAt, maxResults etc. available.
@Hana Kučerová Thanks Hana. This is exactly what i ended up doing this. So if issue search returns, total records in worklog as say 38, i am firing the Get issue worklog to startAt 21 and get the remaining work log items
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vishal Biyani Did You figured out that issue.
If u Figured out issue please let me know.
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Below is the high level approach i used,
1. I used below end point to get 100 results at a time and looped through the result set.
/rest/api/3/search
2. Check
if issue['fields']['worklog']['total'] > 20:
Then use /rest/api/3/issue/{ret_issue['key']}/worklog end point to get worklogs starting from 21st record
Note: As per Step 1, issuekey value is available in the json response ({ret_issue['key']})
Hope this helps
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looking forward to discus your doubts with you.
Let me know your email id, and i will message you.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can refer to this link for illustration on how to use the API
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vishal Biyani Hi Bro
Now iam able to get the all the fields through rest api,, except the all worklogs..iam getting only 20 worklogs..can u please tell me the logic for that..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to use this API https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/#api-rest-api-3-issue-issueidorkey-worklog-get
to get all worklogs if the issue has more than 20 worklogs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vishal Biyani Hi broo..
I tried this api. Iam able to give the range for Tickets and i am not able to give the range for Worklogs...
If you have any time will connect and discuss for this..
Thanks in Advance.
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.
Let's connect over weekend
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vishal Biyani Can u please connect Today, Almost Iam at the last stage,If u connect today it will be more helpful for me...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.