Update "favorite" field for a project in Asana API - asana

There's no documentation for updating the favorite field.
Currently I'm trying the following method:
PUT https://app.asana.com/api/1.0/projects/{projectid}
Post data:
{
"data": {
"favorite": true
}
}
There's no error reported. The Asana API returns the project details as the response with the responseCode 200. But when I view the project in Asana the Favorite field has not been updated.
How do I use the API to modify this field?

Resolved this. The Asana app didn't reflect the changes right away. It took a few moments to show the project in the Favorite list.
If anyone else is looking into this undocumented feature please be aware when setting the favorite field to "1" or "0" (the representation in the the API) it returns the 400 responsecode. The value True or False must be processed and not in quotes.

Related

The team bot did not appear in a team meeting

We are using a Microsoft sample code to join the team meeting and start the recording. The problem which we are facing is When we hit the post method from the postman to join the call using this link in postman (https://testbotaimeet.ngrok.io/joinCall) and body as this:
{
"JoinURL": "https://teams.microsoft.com/l/meetup-join/19:meeting_Y2Y5ODc4ZDUtYmY2Yy00YmVmLTljYTEtYWE4NjcwYjU5ZDc1#thread.v2/0?context=%7B%22Tid%22:%22204d6395-ea6c-4e64-abea-e04cd30845e2%22,%22Oid%22:%225a95f69b-70e2-40d3-8b9a-5810ffcc6ec9%22%7D",
"DisplayName": "Bot"
}
We get the output like this:
{
"callId": "5e1f5a00-140c-47fe-9746-7910b6f39ff1",
"scenarioId": "38b81964-2ae1-476d-a79f-4abf9dd82a95",
"call": "testbotaimeet.ngrok.io/calls/5e1f5a00-140c-47fe-9746-7910b6f39ff1"
}
But the bot did not appear or show in the team meeting why? Please help us with this.
Reference: https://github.com/microsoftgraph/microsoft-graph-comms-samples/tree/master/Samples/V1.0Samples/AksSamples/teams-recording-bot
Sometimes it happened with me also, but later I realized that I was passing old meeting URL. Just make sure that you give correct input. When you pass a old meeting url (already used or even cancelled), it still gives you the response. So make sure that inputs are valid and as expected.

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.

Can't get the options from custom field in JIRA using REST API

Hi I am trying get the options from custom field but always getting the results like:
{
"expan":"projets",
"projects":[]
}
The id for custom field is customfield_10412 and the project key is TCA. Right now I am trying the below uri:
https://atlassian/jira/rest/api/2/issue/createmeta?projectKeys=TCA&issuetypeNames=Test&expand=projects.issuetypes.fields
It could be you are not logged in to your Jira instance yet, therefore you gain no results returned.
Source: https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-basic-authentication
Hope this helps

How to add a flag to jira issue via rest api

I would like to be able to add a flag to an issue via the Jira API. I was unable to find any documentation regarding this issue. Does anyone know how this works?
I've figured out how to do this, I'm not sure on the version of the API. I made a POST request to:
yourdomain /rest/greenhopper/1.0/xboard/issue/flag/flag.json
And in the body (replace JIRA-ISSUE with your issue key):
{"issueKeys":["JIRA-ISSUE"],"flag":true}
I hope this helps.
Here is the best answer I found.
https://answers.atlassian.com/questions/38062844/answers/38062897
There is a field called Flagged. It is a checkbox type field. There is a single value by default, Impediment. The field is checked for null status. If the field is null, the issue is not flagged. If the field is not null, the issue is flagged.
You would use the REST API for this. Examples are here –
https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-create-issue.
You'll either need to know the field ID (customfield_10000) or you need to to script the discovery of the field by searching the metadata – https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-discovering-meta-data-for-creating-issues.
An example of setting a custom field while creating the issue over API –
curl -D- -u fred:fred -X POST --data {"fields":{"project":{"key": "TEST"}, "summary": "Always do right. This will gratify some people and astonish the REST.", "description": "Creating an issue while setting custom field values", "issuetype":{"name": "Bug"}, "customfield_10000": [{"value": "Impediment"}]}} -H "Content-Type: application/json" http://localhost:8090/rest/api/2/issue/
non-minified data Expand source
{
"fields": {
"project":
{
"key": "TEST"
},
"summary": "Always do right. This will gratify some people and astonish the REST.",
"description": "Creating an issue while setting custom field values",
"issuetype": {
"name": "Bug"
},
"customfield_10000": [ {"value": "Impediment" }]
}
}
As mentioned here, "Flagged" is a checkbox custom field that accepts a single value "Impediment".
You should be able to set it using the JIRA REST API just like any other custom field. Maybe the examples here will help.
You can also set custom field values using the JIRA Java API.
I'm struggling with this right now. It seems that the Flagged field is not a checkbox type field anymore, but multicheckbox. So the data format I need to send to Jira Cloud API to set the flag in my case look like this:
{update:
{customfield_10021:
[{set:
[{id:“10019”}]
}]
}
}
To remove the flag the data I sent to Jira look like this:
{update:
{customfield_10021:
[{set:
[]
}]
}
}
In the above customfield_10021 is Flagged field's key and 10019 is id that sets the flag. Both of them you need to figure out for your Jira Cloud instance for example by aquiring issue with set Flagged field and checking how it is set.
Just to make it clear, to add/remove a flag I use edit issue end point described here.
Also, to be able to add/remove flag the Flagged field has to be on the edit screen of the issue type that you want to modify and your user needs to have proper priviliges.

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

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.

Resources