When I do a FindMeetingTimes without any LocationConstraints the suggestions include conference rooms that are remote to my Office Location for e.g., conf rooms in Cleveland while I'm located in Dallas.
I'm trying to understand how FindMeetingTimes works and how we can try to locate the best match of conf rooms.
Appreciate the response.
Without any LocationContraints the API will include conference rooms across your organization.
You need to provide the API some context so it understands which locations make sense. This context is provided by the LocationContraints object. You'll need to populate it with the list of room resources that make sense for you:
"locationConstraint": {
"isRequired": true,
"locations": [{
"resolveAvailability": true,
"displayName": "Room 1",
"locationEmailAddress": "room1#contoso.com"
},
{
"resolveAvailability": true,
"displayName": "Room 3",
"locationEmailAddress": "room3#contoso.com"
},
{
"resolveAvailability": true,
"displayName": "Room 3",
"locationEmailAddress": "room3#contoso.com"
}
],
"suggestLocation": true
}
Related
We have developed an outlook add in that adds a custom property to an event. This is working fine and if I query the MS Graph API as the organiser I can see the custom property returned.
#Query
https://graph.microsoft.com/v1.0/me/events?$expand=singleValueExtendedProperties($filter=id eq 'String {00020329-0000-0000-C000-000000000046} Name cecp-f7f0d3d0-21c3-4c6e-91f5-edaee4e32466')
#Response
{
...
"value": [
{
...
"attendees": [
{
"type": "required",
"status": {
"response": "none",
"time": "1601-01-01T00:00:00Z"
},
"emailAddress": {
"name": "Adele Vance",
"address": "AdeleV#domain.onmicrosoft.com"
}
}
],
"singleValueExtendedProperties#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('abc1234-b90f-469f-9a92-6eb23af30276')/events('AAMkADlhNzdjZWY2LWVjNjQtNGExNi1iNDZjLTA4M2Q1ZWM3MTMzMgBGAAAAAAAoycA_ZVHiTq8VDwWB362DBwAI-BzSjmJPQJ2LM7A8Gj1OAAAAAAENAAAI-BzSjmJPQJ2LM7A8Gj1OAAC_N5E_AAA%3D')/singleValueExtendedProperties",
"singleValueExtendedProperties": [
{
"id": "String {00020329-0000-0000-c000-000000000046} Name cecp-f7f0d3d0-21c3-4c6e-91f5-edaee4e32466",
"value": "{\"id\":\"ABC\"}"
}
]
}
]
However, if I try and run the same query for an attendee (Adele Vance) then I don't get the singleValueExtendedProperties returned.
Are the extended properties only available to the user who added them? I can see the metadata includes my user Id, however this seems very limiting.
Any help much appreciated.
Iain
Yes, the attendee appointment is created by the organizer sending a meeting invitation. The invitation does not include any custom properties.
I have a question related to sending a message to Slack from Jenkins (groovy script).
Currently, I use SlackNotificationPlugin for sending messages to Slack and I'm trying to send line for the whole width of Slack, but instead of it, I can use only half of Slack width.
I use code below:
msg = readJSON text: """
{
"pretext": "<placeholder>",
"text": "<placeholder>",
"color": "good",
"mrkdwn_in": [
"pretext",
"text"
],
"fields": [
{
"title": "A field's title",
"value": "This field's valueaaaaaaaaaaaa valueaaaaaaaaaaaa valueaaaaaaaaaaaa valueaaaaaaaaaaaa valueaaaaaaaaaaaa valueaaaaaaaaaaaa valueaaaaaaaaaaaa",
"short": false
},
{
"title": "A short field's title",
"value": "A short field's value",
"short": true
},
{
"title": "A second short field's title",
"value": "A second short field's value",
"short": true
}
],
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Alternative hotel options*"
}
}
]
}
"""
msg.pretext = pretext.inspect()
msg.text = text.inspect()
slack_channel = partner_channel
slackSend(channel: slack_channel, color: 'good', attachments: "[${msg.toString()}]")
On the screenshot below you can see Packages Difference and it showed only on the half of the page.
I found a solution for this case and I tested it in Slack Block Kit Builder:
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "```{8}```"
}
}
]
}
https://app.slack.com/block-kit-builder/T025QN6JG#%7B%22blocks%22:%5B%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22%60%60%60%7B8%7D%60%60%60%22%7D%7D%5D%7D
It Slack Block Kit Builder, I can successfully send a message and use the whole space of slack:
In official documentation for Jenkins Slack Plugin (https://plugins.jenkins.io/slack/), I found that for sending blocks we can use the next construction:
blocks = [
[
"type": "section",
"text": [
"type": "mrkdwn",
"text": "Hello, Assistant to the Regional Manager Dwight! *Michael Scott* wants to know where you'd like to take the Paper Company investors to dinner tonight.\n\n *Please select a restaurant:*"
]
],
[
"type": "divider"
],
[
"type": "section",
"text": [
"type": "mrkdwn",
"text": "*Farmhouse Thai Cuisine*\n:star::star::star::star: 1528 reviews\n They do have some vegan options, like the roti and curry, plus they have a ton of salad stuff and noodles can be ordered without meat!! They have something for everyone here"
],
"accessory": [
"type": "image",
"image_url": "https://s3-media3.fl.yelpcdn.com/bphoto/c7ed05m9lC2EmA3Aruue7A/o.jpg",
"alt_text": "alt text for image"
]
]
]
slackSend(channel: "#general", blocks: blocks)
The mentioned code doesn't work for me I have nothing in Slack when I use block construction.
Can somebody help me with it? I don't use any Bot User, I just want to send the output of Jenkins to Slack.
Thanks in advance.
I'm building a simple slack bot and I am playing with the checkboxes element.
When I return the following from my API in a JSON response to a slash-command I get an error failed with the error "invalid_blocks", however, when I put this in the block-kit-builder it works perfectly (including "sending to slack" button)
Any ideas why this is failing when I run my slash command - and is it possible to see more detailed error messages from slack?
{
"blocks": [
{
"elements": [
{
"style": "primary",
"text": {
"emoji": true,
"text": "Create new TODO list",
"type": "plain_text"
},
"type": "button",
"value": "value"
},
{
"style": "primary",
"text": {
"emoji": true,
"text": "Help",
"type": "plain_text"
},
"type": "button",
"value": "value"
}
],
"type": "actions"
},
{
"text": {
"text": "Today",
"type": "mrkdwn"
},
"type": "section"
},
{
"elements": [
{
"initial_options": [
{
"text": {
"text": "Get Into the garden",
"type": "mrkdwn"
},
"value": "foo"
}
],
"options": [
{
"text": {
"text": "Get Into the garden",
"type": "mrkdwn"
},
"value": "foo"
}
],
"type": "checkboxes"
},
{
"style": "primary",
"text": {
"emoji": true,
"text": "Add new Task",
"type": "plain_text"
},
"type": "button",
"value": "value"
}
],
"type": "actions"
}
],
"type": "home"
}
I am using the Slack Web API. I was getting the similar error. After a lot of looking around, here's how I solved it.
import json
blocks = [{...}]
payload = {
"blocks": json.dumps(blocks)
}
You will then send this payload.
in the api, the "blocks" parameter need to be string type. Did you convert it to string or you use it as a JSON ?
https://api.slack.com/methods/chat.postMessage
In the Block Kit Builder, the data is a JSON with a blocks key.
In the Slack API, the blocks param is only the list of JSON objects.
blocks = [
{
"text": {
"text": "Its the list of your blocks",
"type": "mrkdwn"
},
"type": "section"
}
]
text = 'Alternative data in text'
client.chat_postMessage(channel=channel_id, blocks=blocks, text=text)
Another cause of this problem seems to be too many blocks being returned. I can't find any documentation about this whatsoever, but personal experience seems to indicate about 20 blocks is the maximum.
An alternative is to return fewer blocks, with paging actions -- paging works well with the "replace" message so that the content being paged through does not result in many separate messages.
It appears that not all valid elements in block kit tool can be posted as a message, despite the fact that message preview works fine in the Block Tool.
In my case, the code failed when I included an input block and passed when i removed it. The input block was generated by the Block Kit tool.
{
"type": "input",
"element": {
"type": "plain_text_input",
"action_id": "plain_text_input-action"
},
"label": {
"type": "plain_text",
"text": "Feedback",
"emoji": true
}
}
The error was
{'ok': False, 'error': 'invalid_blocks'}
Also, although the documentation for python says you need to urlEncode the JSON-based array, there is no example, and it is incorrect. https://api.slack.com/methods/chat.postMessage
You can see on line 29 in the SDK test code below that blocks= takes a regular list of dicts not a string.
https://github.com/slackapi/python-slack-sdk/blob/c9dc6aa0907a72c16cf36aa15e7e80031a9fdce2/integration_tests/samples/basic_usage/sending_a_message.py
When reviewing some example OneDrive Items using Graph Explorer, it appears that the user.id and the parentReference.driveId are identical. Is MSFT re-using one Id to identify both the user and drive object?
I have been testing my app against a number of OneDrive Business accounts and I do not believe I have seen this scenario. I would like to understand if this is something specific to OneDrive Personal and/or what implications it might have...
I am not sure this will cause any issues, but my understanding was that all "IDs" were generally unique.
Here's a redacted snippet of JSON returned from Graph Explorer to illustrate what I am seeing:
{
"#microsoft.graph.downloadUrl": "https://xxx.yyy",
"createdDateTime": "2018-12-04T19:02:41.173Z",
"cTag": "aYzpDQjBCMTc0REJFRUY2RTU4ITMxNzEuMjI1",
"eTag": "aQ0IwQjE3NERCRUVGNkU1OCEzMTcxLjk",
"id": "<MY_USER_ID>!3171",
"lastModifiedDateTime": "2018-12-04T19:10:36.83Z",
"name": "blah-2018.docx",
"size": 250538,
"webUrl": "https://1drv.ms/...",
"createdBy": {
"application": {
"displayName": "MSOffice15",
"id": "480728c5"
},
"device": {
"id": "188000899fbcaf"
},
"user": {
"displayName": "My Name",
"id": "<MY_USER_ID>"
}
},
"lastModifiedBy": {
"application": {
"displayName": "MSOffice15",
"id": "480728c5"
},
"device": {
"id": "188000899fbcaf"
},
"user": {
"displayName": "My Name",
"id": "<MY_USER_ID>"
}
},
"parentReference": {
"driveId": "<MY_USER_ID>",
"driveType": "personal",
"id": "<MY_USER_ID>!109",
"path": "/drive/root:"
},
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"hashes": {
"sha1Hash": "F0370F54348ED81F421EB036868AEBE5253AF58A"
}
},
"fileSystemInfo": {
"createdDateTime": "2018-12-04T19:02:41.173Z",
"lastModifiedDateTime": "2018-12-04T19:02:38.633Z"
}
},
Note that MY_USER_ID is all uppercase in the prefix of the driveItem.Id. It is all lowercase as my driveId and my userId.
OneDrive Personal isn't reusing the same id, it's using the User's Id as a prefix for Drive and DriveItem ids:
{User Id}!{OneDrive ID}
Since there is a 1:1 relationship between an MSA and it's Drive, there isn't much call for a more complex mechanism. OneDrive for Business, on the other hand, is hosted in SharePoint and, as such, use's SharePoint's identifiers.
`
I need to display the the "Area path" in a VSTS Build task input PickList, so that I can retrieve the user selected "Area path" value from my build task and set it in a work item generated by the build task. Is this possible with existing VSTS API? If so how to do this?
I think this is done in Copy Files task in Utilty section.
Thanks in advance.
Yes, it is. You can add following section in task.josn file to achieve this:
"inputs": [
{
"name": "rootArea",
"type": "pickList",
"label": "rootArea",
"defaultValue": "",
"required": false,
"helpMarkDown": "Select the root area.",
"properties": {
"DisableManageLink": "True"
}
},
{
"name": "childArea",
"type": "pickList",
"label": "childArea",
"defaultValue": "",
"required": false,
"helpMarkDown": "Select the child area.",
"properties": {
"DisableManageLink": "True"
}
}
],
"sourceDefinitions": [
{
"target": "rootArea",
"endpoint": "/$(system.teamProject)/_apis/wit/classificationNodes/areas?$depth=2&api-version=1.0",
"selector": "jsonpath:$.name",
"keySelector": "jsonpath:$.name",
"authKey": "tfs:teamfoundation"
},
{
"target": "childArea",
"endpoint": "/$(system.teamProject)/_apis/wit/classificationNodes/areas?$depth=2&api-version=1.0",
"selector": "jsonpath:$.children[*].name",
"keySelector": "jsonpath:$.children[*].name",
"authKey": "tfs:teamfoundation"
}
],
And you will get the build task like this:
However, due to data structure in the response of classification nodes api, you have to add more inputs when there are more level of child areas.