JIRA REST API issue transitions and worklog (v4.4.1) - jira

Is it possible to update the worklog for an issue when transitioning (i.e. POST to /rest/api/latest/issue/{issueid}/transitions) via the REST API for JIRA (API version is 2.0.alpha1 of JIRA v4.4.1)? I'm posting a worklog as part of the request and looking for the minimum information I need to send (currently just minutesSpent and started time as these seem to be the only mandatory ones via the UI).
i.e.
worklog:
{
name: "worklog",
type: "worklog",
value: [
{
started: "2012-10-01T10:28:00.000+1000",
minutesSpent: 480
}
]
},
Currently the post to the URL seems to just ignore this additional data although the transition does take effect with a desired 204 response.

From the JIRA REST API Docs:
The fields that can be set on transtion, in either the fields parameter or the update parameter can be determined using the /rest/api/2/issue/{issueIdOrKey}/transitions?expand=transitions.fields resource. If a field is not configured to appear on the transition screen, then it will not be in the transition metadata, and a field validation error will occur if it is submitted.
If, in the response you get from the expansion, you don't see worklog, then I don't think it is possible.

Related

MS Graph API ... create Planner task including details/description using one single HTTP request?

I am using the Microsoft Graph API to create Planner tasks, and I am wondering if there is a way to create a task including task details/description using a single HTTP request.
This old question from 2018 is asking about the same thing. The outcome in 2018 was that several separate requests were necessary ... first creating the task, then getting and updating its details object, which is a somewhat cumbersome process.
The original answerer has recently updated their answer to say that this behavior has changed and "you can set task details fields in the same request as creating the task". However, I'm confused as to whether this applies to the REST API itself, or to the Microsoft SDKs (which I am not currently using, as I don't need most of their functionality).
When I make a POST request to the /planner/tasks endpoint, and supply the details object in the body like such ...
{
"planId": "(... plan ID ...)",
"bucketId": "(... bucket ID ...)",
"title": "Title for new task",
"details": {
"description": "Some description for new task"
},
"assignments": {
(... assignment data ...)
}
}
... the task is created, but I don't see any description/notes. This applies both to the "v1.0" and "beta" APIs. (I tried the newer "notes" property on the beta API as well, with the same result.)
Based on the MS docs I could not find a conclusive answer either.
Should a request such as the one I listed work right now? If yes, in which API version? If no, what am I missing?
Thanks!
That request should work, but there is an issue with the returned response to the create operation not including the task details. If you read the task details after the creation (or reading task expanding the details), the description should be there.

Updating isOnlineMeeting in M365 event via MS Graph

What I'm doing is creating a calendar event in M365 via the EWS API. I want to set isOnlineMeeting and onlineMeetingProvider, but those properties are not writable in EWS. So my idea was to take the itemId of the new event, and use Microsoft Graph to update just those two properties. I had to alter the itemId a bit to get Graph to accept it (changed / to -) but it appears to "work" in the sense that the PATCH command comes back with response 200. But the properties do not get modified. Here is the json that I give to the PATCH command:
{
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"
}
Here is the URL (shortened for brevity):
PATCH /v1.0/users/me/calendars/AQMkAG.../events/AAMkAG...
As I said, the http response code is 200. The output from the PATCH is a listing of all of the event properties. The ones I am trying to modify are unchanged. The funny thing is, I could have sworn I had this working last week, but my tests this week all fail. Any ideas?

Eventbrite API get full description

When using an eventbrite api end point e.g.
https://www.eventbriteapi.com/v3/events/11111/?token=xxx
I only get the summary description e.g.
"description": {
"text": "Short description",
"html": "Short description"
},
Is there a way to get the full description?
That is strange... I ran a call to the API and I received a full description.
*Note: The description was on multiple lines.
Can you share the event_id this is happening to?
*Also, Note: I am using iTerm, Python with the requests package, and pretty print package(pprint) to make my calls to the API. Could this be a settings issue with the tool you are using to make the calls?
This is mentioned about the retrieve event endpoint.
Note: If the Event being retrieved was created using the new version of Create, then you may notice that the Event’s description field is now being used to hold the event summary. To retrieve your event’s fully-rendered HTML description, you will need to make an additional API call to retrieve the Event's full HTML description.
So, to fetch an events description, use this endpoint:
https://www.eventbrite.com/platform/api#/reference/event/retrieve/retrieve-event-html-description
This is the endpoint, in case someone gets here after Jul 2020 https://www.eventbriteapi.com/v3/events/event_id/description/
I had the same issue and found this on the official documentation: Retrieve full HTML description.
The reason is that, as mentioned in Sheldon's answer (and here in docs):
To retrieve your event’s fully-rendered HTML description, you will need to make an additional API call to retrieve the Event's full HTML description.

MS Graph API response not returning all the data items it supposed to

My intention is to build a Machine Learning program that will give a recommendation for archiving email item by reading all previous email history.
For that, I am trying to read all the email item from:
https://graph.microsoft.com/beta/me/messages
First I am getting the total number of email items in my account using /messages?$count=true which returns 1881 as the result.
Then I am trying to get all the 1881 item using:
https://graph.microsoft.com/beta/me/messages?$top=1881
But the problem is that returns 976 email items. Where are the rest of the email item? How I can find them?
Are you getting a #odata:nextLink property in your response?
If that's the case, you might need to send another request with a skiptoken parameter. It should contain a value from the #odata:nextLink response property.
On the "paging" documentation page - https://developer.microsoft.com/en-us/graph/docs/concepts/paging - it is specified that different APIs have different max page size. It's possible that the endpoint for fetching emails does not support a page size of 1881. In that case, you might need to access a second page of the results.
Another suggestion is to replace beta endpoint with the V1 API call because me/messages is available there also - https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list_messages

Get issues by label in Jira

I'm unable to get issues with needed label from REST API of Jira.
I'm sending GET request to the jira_url/rest/api/2/search?jql=project=MYPROJ&label=build1. In response I get 50 random items. I know that with this label exist only 2 items, but can't get them both.
I was serfing JIRA REST API documentation, but haven't found good examples how to get issues with items in array at least. Also tried the same via POST request with body:
{
"fields": [{"labels": ["build1"] }]
}
Tried similar examples from https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-query-issues
Any easy way to get the JQL Query String to use is to use the Issue Search UI and look at the generated URL at the top and to just grab the jql part:
So the part to add the labels section is:
%20AND%20labels%20in%20(build1%2C%20build2)
Which is and labels in (build1, build2). It is important to note that using the & makes the REST API things the JQL query parameter has ended which is why you need to use the space encoded character of %20 and then the AND keyword to build your JQL.

Resources