I had set up graph client notification for event updates, when I add a category to an existing event, the updated event from notification is missing the applied category sometimes. I tried to get the event at some intervals and found out that the category does show up but there is no definite time delay, does anyone know what could be the max delay or any technique to get the category immediately?
Code used to subscribe for notifications.
POST https://graph.microsoft.com/v1.0/subscriptions
Content-Type: application/json
{
"changeType": "created,updated",
"notificationUrl": "https://webhook.azurewebsites.net/notificationClient",
"resource": "/users/{userId}/mailfolders('inbox')/events",
"expirationDateTime": "2016-03-20T11:00:00.0000000Z",
"clientState": "abcd"
}
Received notification on updating an event (Added a new category to event)
{
"changeType": "updated",
"clientState": "abc",
"resource": "Users/{UserId}/Events/AAMkAGJjMGZiYmVmLTdkNzctNDFjMy05MDdmLTQ5MzM1NWZjZWVhZQBGAAAAAACcxCFvSYx4Qq2TvvDk7ptoBwApGtasXg2jRLv-yfVbSS5rAAAAAAENAAApGtasXg2jRLv-yfVbSS5rAAE3GB9UAAA=",
"subscriptionExpirationDateTime": "2022-02-09T00:07:27.333244-08:00",
"subscriptionId": "00508233-d60c-4905-8c4f-cb101a43f8c1",
"resourceData": {
"id": "AAMkAGJjMGZiYmVmLTdkNzctNDFjMy05MDdmLTQ5MzM1NWZjZWVhZQBGAAAAAACcxCFvSYx4Qq2TvvDk7ptoBwApGtasXg2jRLv-yfVbSS5rAAAAAAENAAApGtasXg2jRLv-yfVbSS5rAAE3GB9UAAA=",
"#odata.etag": "W/\"DwAAABYAAAApGtasXg2jRLv/yfVbSS5rAAE4W5d/\"",
"#odata.id": "Users/bfc9acdc-7ae7-4cbe-af4f-843acd8945d8/Events/AAMkAGJjMGZiYmVmLTdkNzctNDFjMy05MDdmLTQ5MzM1NWZjZWVhZQBGAAAAAACcxCFvSYx4Qq2TvvDk7ptoBwApGtasXg2jRLv-yfVbSS5rAAAAAAENAAApGtasXg2jRLv-yfVbSS5rAAE3GB9UAAA=",
"#odata.type": "#Microsoft.Graph.Event"
}
}
When I tried to get the event from graph client the category was missing in the category list
{
"allowNewTimeProposals": true,
"attendees": [],
"body": {
"content": "",
"contentType": "html",
"#odata.type": "microsoft.graph.itemBody"
},
"bodyPreview": "",
"end": {
"dateTime": "2022-01-23T03:30:00.0000000",
"timeZone": "UTC",
"#odata.type": "microsoft.graph.dateTimeTimeZone"
},
"hasAttachments": false,
"hideAttendees": false,
"iCalUId": "040000008200E00074C5B7101A82E00800000000FA8C485E1718D8010000000000000000100000002019A4F391D06D40B7A90ACC0E408951",
"importance": "normal",
"isAllDay": false,
"isCancelled": false,
"isDraft": false,
"isOnlineMeeting": false,
"isOrganizer": true,
"isReminderOn": true,
"location": {
"displayName": "ABCD",
"locationType": "default",
"uniqueId": "ABCD",
"uniqueIdType": "private",
"#odata.type": "microsoft.graph.location"
},
"locations": [
{
"displayName": "ABCD",
"locationType": "default",
"uniqueId": "ABCD",
"uniqueIdType": "private",
"#odata.type": "microsoft.graph.location"
}
],
"onlineMeetingProvider": "unknown",
"organizer": {
"emailAddress": {
"address": "{userEmail}",
"name": "{Name}",
"#odata.type": "microsoft.graph.emailAddress"
},
"#odata.type": "microsoft.graph.recipient"
},
"originalEndTimeZone": "Sri Lanka Standard Time",
"originalStartTimeZone": "Sri Lanka Standard Time",
"reminderMinutesBeforeStart": 15,
"responseRequested": true,
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00+00:00",
"#odata.type": "microsoft.graph.responseStatus"
},
"sensitivity": "normal",
"showAs": "busy",
"start": {
"dateTime": "2022-01-23T03:00:00.0000000",
"timeZone": "UTC",
"#odata.type": "microsoft.graph.dateTimeTimeZone"
},
"subject": "Test1234",
"transactionId": "BFA967CF-A111-5A49-8564-C74031DEA04B_6F9F0BA5-05C8-465F-9B56-5E3318BFF06B_343",
"type": "singleInstance",
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkAGJjMGZiYmVmLTdkNzctNDFjMy05MDdmLTQ5MzM1NWZjZWVhZQBGAAAAAACcxCFvSYx4Qq2TvvDk7ptoBwApGtasXg2jRLv%2FyfVbSS5rAAAAAAENAAApGtasXg2jRLv%2FyfVbSS5rAAE0tLDTAAA%3D&exvsurl=1&path=/calendar/item",
"categories": [],
"changeKey": "KRrWrF4No0S7/8n1W0kuawABNJg+hw==",
"createdDateTime": "2022-02-02T09:29:25.2557072+00:00",
"lastModifiedDateTime": "2022-02-02T09:37:47.6734052+00:00",
"id": "AAMkAGJjMGZiYmVmLTdkNzctNDFjMy05MDdmLTQ5MzM1NWZjZWVhZQBGAAAAAACcxCFvSYx4Qq2TvvDk7ptoBwApGtasXg2jRLv-yfVbSS5rAAAAAAENAAApGtasXg2jRLv-yfVbSS5rAAE0tLDTAAA=",
"#odata.type": "microsoft.graph.event",
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('{userId}')/events/$entity",
"#odata.etag": "W/\"KRrWrF4No0S7/8n1W0kuawABNJg+hw==\"",
"occurrenceId": null,
"calendar#odata.associationLink": "https://graph.microsoft.com/v1.0/users('{userId}')/calendars('AAMkAGJjMGZiYmVmLTdkNzctNDFjMy05MDdmLTQ5MzM1NWZjZWVhZQAuAAAAAACcxCFvSYx4Qq2TvvDk7ptoAQApGtasXg2jRLv-yfVbSS5rAAAAAAENAAA=')/$ref",
"calendar#odata.navigationLink": "https://graph.microsoft.com/v1.0/users('userId')/calendars('AAMkAGJjMGZiYmVmLTdkNzctNDFjMy05MDdmLTQ5MzM1NWZjZWVhZQAuAAAAAACcxCFvSYx4Qq2TvvDk7ptoAQApGtasXg2jRLv-yfVbSS5rAAAAAAENAAA=')",
"responseHeaders": {
"cache-Control": ["private"],
"transfer-Encoding": ["chunked"],
"vary": ["Accept-Encoding"],
"strict-Transport-Security": ["max-age=31536000"],
"request-id": ["110a7a40-540d-46d2-9687-a50ea7994ab9"],
"client-request-id": ["110a7a40-540d-46d2-9687-a50ea7994ab9"],
"x-ms-ags-diagnostic": [
"{\"ServerInfo\":{\"DataCenter\":\"South India\",\"Slice\":\"E\",\"Ring\":\"2\",\"ScaleUnit\":\"000\",\"RoleInstance\":\"MA1PEPF00002512\"}}"
],
"date": ["Wed, 02 Feb 2022 09:37:50 GMT"]
},
"statusCode": "OK"
}
Related
I have nested JSON data like below:
{
"resourceType": "Patient",
"identifier": [{
"use": "usual",
"type": {
"coding": [{
"code": "MR",
"display": "Medical Record Number"
}],
"text": "Medical Record Number"
},
"system": "http://example.com",
"value": "1032702",
"assigner": {
"reference": "Organization/198723168",
"display": "Reference Organization",
"data": {
"resourceType": "Organization",
"implicitRules": "",
"language": "",
"contained": "",
"extension": "",
"alias": "",
"contact": "",
"modifierExtension": "",
"active": true,
"name": "Clinic",
"address": [{
"line": [
"3300 Washtenaw Avenue, Suite 227"
],
"city": "Amherst",
"state": "MA",
"postalCode": "01002",
"country": "USA"
}]
}
}
}]
}
In serializers create method, I want to get the data which is nested to identifier->assigner and store that in organization serializer which different than this to which I am POSTing these data. For top level data I can do like validated_data.pop('identifier'). Is there a similar way for nested one?
I have a messaging extension bot in my Teams app, which is sending the following response when it receives a composeExtension/submitAction POST request:
{
"composeExtension": {
"attachments": [
{
"content": {
"type": "AdaptiveCard",
"body": [
{
"items": [
{
"color": null,
"horizontalAlignment": null,
"isSubtle": false,
"maxLines": 0,
"size": "large",
"text": "Solution: DoorDash",
"weight": "bolder",
"wrap": false,
"separator": false,
"type": "TextBlock"
},
{
"color": null,
"horizontalAlignment": null,
"isSubtle": true,
"maxLines": 0,
"size": "small",
"text": "No Needs • No Comments • No Upvotes",
"weight": null,
"wrap": true,
"separator": false,
"type": "TextBlock"
}
],
"separator": false,
"type": "Container"
},
{
"items": [
{
"horizontalAlignment": null,
"style": null,
"url": "https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fs3.us-east-1.amazonaws.com%2fstartgrid-v2-test-crunchbase-images%2forganizations%2fb%2f2%2fb2cximlauocyxfs2lkfh",
"width": "100px",
"height": "100px",
"separator": false,
"type": "Image"
},
{
"color": null,
"horizontalAlignment": null,
"isSubtle": false,
"maxLines": 0,
"size": null,
"text": "",
"weight": null,
"wrap": false,
"separator": false,
"type": "TextBlock"
},
{
"color": null,
"horizontalAlignment": null,
"isSubtle": false,
"maxLines": 0,
"size": null,
"text": "DoorDash enables delivery in areas where it was not previously available. The company's mission is to empower small business owners to offer delivery in an affordable and convenient way. We are achieving this mission first by enabling restaurant food delivery. DoorDash was founded in February 2013 by four Stanford students with experiences from Facebook, Square, Vevo, and eBay.",
"weight": null,
"wrap": false,
"separator": false,
"type": "TextBlock"
}
],
"separator": false,
"type": "Container"
}
],
"actions": [
{
"url": "xxxxxxxxxx",
"title": "View Solution",
"type": "Action.OpenUrl"
},
{
"url": "https://teams.microsoft.com/l/task/60864eb3-18fc-4710-9029-412157bce86b?height=600&url=xxxxxxxxxxx",
"title": "Add Comment",
"type": "Action.OpenUrl"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
},
"contentType": "application/vnd.microsoft.card.adaptive"
}
],
"type": "result",
"attachmentLayout": "list"
},
"responseType": "composeExtension"
}
The POST request has a 200 status code but the adaptive card fails to render and the following error message is displayed in the console: BotCardService: Error while resolving MRI from appAttribution. Error msg: {}
Please could you provide further information on what this error relates to?
Thanks.
Here are the steps you can follow:
We should add the commands in compose extension section in manifest file like below:
"composeExtensions": [
{
"botId": "xxxxxx-59e6-49b8-8b94-xxxxxxxxxx",
"commands": [
{
"id": "createAdaptiveCard",
"type": "action",
"context": [ "compose" ],
"description": "Command to run action to create a Card from Compose Box",
"title": "Adaptive Card",
"parameters": [
{
"name": "title",
"title": "Name",
"description": "Name of the User",
"inputType": "text"
},
{
"name": "subTitle",
"title": "Designation",
"description": "Designation of the User",
"inputType": "text"
},
{
"name": "text",
"title": "Description",
"description": "Description",
"inputType": "textarea"
}
]
},
{
"id": "webView",
"description": "Fetch the Web View",
"title": "Web View",
"type": "action",
"fetchTask": true,
"context": [ "compose" ]
},
{
"id": "HTML",
"description": "Fetch the HTML",
"title": "HTML",
"type": "action",
"fetchTask": true,
"context": [ "compose" ]
},
{
"id": "razorView",
"description": "Fetch the Razor View",
"title": "Razor View",
"type": "action",
"fetchTask": true,
"context": [ "compose" ]
}
]
}
],
You need to invoke the "createAdaptiveCard" action from the Messaging Extension action.
It will open a AdaptiveCard popup which is configured in your manifest.
Once you submit the card, it will handle the request at server side in below method:
protected override async Task OnTeamsMessagingExtensionSubmitActionAsync(ITurnContext turnContext, MessagingExtensionAction action, CancellationToken cancellationToken)
As a return response, you can return the Adaptive Card as attachment.
We have tried it at our end and it is working fine.
Please find below screenshot of it.
Please find below sample link for your reference:
https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/51.teams-messaging-extensions-action
I want to use ELK stack to analyze some Kubernetes audit logs. They're sent to the Logstash webhook as JSON. Here's my config file :
input{
http {
port => 8888
codec => "json"
type => "json"
}
}
filter{
json {
source => "message"
}
}
output{
file {
path => "/home/ubuntu/logstash-kubernetes/audit.log"
}
elasticsearch{
hosts => "localhost:9200"
index => "kubernetes"
}
}
The output file is populated with good looking entries, I'm happy with it. But when it comes to exporting to Elasticsearch, I'm getting the following error :
elasticsearch - Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"kubernetes", :routing=>nil, :_type=>"_doc"}, #<LogStash::Event:0x71740f4b>], :response=>{"index"=>{"_index"=>"kubernetes", "_type"=>"_doc", "_id"=>"x6QKJHYBkIKyNOo2Q-z8", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse", "caused_by"=>{"type"=>"array_index_out_of_bounds_exception", "reason"=>"Index -1 out of bounds for length 0"}}}}}
It only happens for some entries. Let me show you an generated entry that was processed without error :
{
"_index": "kubernetes",
"_type": "_doc",
"_id": "xKQKJHYBkIKyNOo2POwJ",
"_version": 1,
"_score": 0,
"_source": {
"headers": {
"content_type": "application/json",
"request_method": "POST",
"accept_encoding": "gzip",
"request_path": "/",
"http_host": "****:8888",
"http_accept": "application/json, */*",
"content_length": "2813",
"http_version": "HTTP/1.1",
"http_user_agent": "Go-http-client/1.1"
},
"#version": "1",
"host": "****",
"apiVersion": "audit.k8s.io/v1",
"items": [
{
"requestObject": {
"type": "Normal",
"firstTimestamp": "2020-12-02T15:20:19Z",
"involvedObject": {
"namespace": "kube-system",
"name": "kube-scheduler",
"apiVersion": "v1",
"resourceVersion": "2573",
"uid": "0ebf0ea5-f8c0-475a-9c9e-57674edefe8d",
"kind": "Endpoints"
},
"message": "****1_938d6a87-bccb-4ea0-bd6b-31fc27e48b7a became leader",
"eventTime": null,
"source": {
"component": "default-scheduler"
},
"reason": "LeaderElection",
"count": 1,
"reportingInstance": "",
"apiVersion": "v1",
"reportingComponent": "",
"lastTimestamp": "2020-12-02T15:20:19Z",
"metadata": {
"name": "kube-scheduler.164cef6d1f3ed55e",
"namespace": "kube-system",
"creationTimestamp": null
},
"kind": "Event"
},
"requestURI": "/api/v1/namespaces/kube-system/events",
"responseStatus": {
"code": 201,
"metadata": {}
},
"user": {
"groups": [
"system:authenticated"
],
"username": "system:kube-scheduler"
},
"annotations": {
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"system:kube-scheduler\" of ClusterRole \"system:kube-scheduler\" to User \"system:kube-scheduler\"",
"authorization.k8s.io/decision": "allow"
},
"stageTimestamp": "2020-12-02T15:20:19.090835Z",
"userAgent": "kube-scheduler/v1.19.4 (linux/amd64) kubernetes/d360454/scheduler",
"objectRef": {
"namespace": "kube-system",
"name": "kube-scheduler.164cef6d1f3ed55e",
"apiVersion": "v1",
"resource": "events"
},
"responseObject": {
"type": "Normal",
"firstTimestamp": "2020-12-02T15:20:19Z",
"involvedObject": {
"namespace": "kube-system",
"name": "kube-scheduler",
"apiVersion": "v1",
"resourceVersion": "2573",
"uid": "0ebf0ea5-f8c0-475a-9c9e-57674edefe8d",
"kind": "Endpoints"
},
"message": "****1_938d6a87-bccb-4ea0-bd6b-31fc27e48b7a became leader",
"eventTime": null,
"source": {
"component": "default-scheduler"
},
"reason": "LeaderElection",
"count": 1,
"reportingInstance": "",
"apiVersion": "v1",
"reportingComponent": "",
"lastTimestamp": "2020-12-02T15:20:19Z",
"metadata": {
"name": "kube-scheduler.164cef6d1f3ed55e",
"namespace": "kube-system",
"creationTimestamp": "2020-12-02T15:20:19Z",
"managedFields": [
{
"operation": "Update",
"fieldsType": "FieldsV1",
"time": "2020-12-02T15:20:19Z",
"manager": "kube-scheduler",
"apiVersion": "v1",
"fieldsV1": {
"f:source": {
"f:component": {}
},
"f:lastTimestamp": {},
"f:reason": {},
"f:firstTimestamp": {},
"f:type": {},
"f:involvedObject": {
"f:kind": {},
"f:namespace": {},
"f:name": {},
"f:apiVersion": {},
"f:uid": {},
"f:resourceVersion": {}
},
"f:message": {},
"f:count": {}
}
}
],
"resourceVersion": "2576",
"selfLink": "/api/v1/namespaces/kube-system/events/kube-scheduler.164cef6d1f3ed55e",
"uid": "573e4082-7c38-473c-9116-a114be97a47d"
},
"kind": "Event"
},
"level": "RequestResponse",
"requestReceivedTimestamp": "2020-12-02T15:20:19.021481Z",
"auditID": "cf291b3f-f5fa-4e43-a177-adf9cbfc0197",
"sourceIPs": [
"****"
],
"stage": "ResponseComplete",
"verb": "create"
}
],
"#timestamp": "2020-12-02T15:20:19.094Z",
"type": "json",
"metadata": {},
"kind": "EventList"
}
}
And here's the JSON for that error happens :
{
"headers": {
"content_type": "application/json",
"request_method": "POST",
"accept_encoding": "gzip",
"request_path": "/",
"http_host": "****:8888",
"http_accept": "application/json, */*",
"content_length": "2668",
"http_version": "HTTP/1.1",
"http_user_agent": "Go-http-client/1.1"
},
"#version": "1",
"host": "****",
"apiVersion": "audit.k8s.io/v1",
"items": [
{
"requestObject": {
"metadata": {
"name": "kube-scheduler",
"namespace": "kube-system",
"creationTimestamp": "2020-12-02T14:36:33Z",
"annotations": {
"control-plane.alpha.kubernetes.io/leader": "{\"holderIdentity\":\"****38d6a87-bccb-4ea0-bd6b-31fc27e48b7a\",\"leaseDurationSeconds\":15,\"acquireTime\":\"2020-12-02T15:18:52Z\",\"renewTime\":\"2020-12-02T15:18:52Z\",\"leaderTransitions\":67}"
},
"managedFields": [
{
"operation": "Update",
"fieldsType": "FieldsV1",
"time": "2020-12-02T15:18:23Z",
"manager": "kube-scheduler",
"apiVersion": "v1",
"fieldsV1": {
"f:metadata": {
"f:annotations": {
".": {},
"f:control-plane.alpha.kubernetes.io/leader": {}
}
}
}
}
],
"resourceVersion": "2531",
"selfLink": "/api/v1/namespaces/kube-system/endpoints/kube-scheduler",
"uid": "0ebf0ea5-f8c0-475a-9c9e-57674edefe8d"
},
"apiVersion": "v1",
"kind": "Endpoints"
},
"requestURI": "/api/v1/namespaces/kube-system/endpoints/kube-scheduler?timeout=10s",
"responseStatus": {
"code": 200,
"metadata": {}
},
"user": {
"groups": [
"system:authenticated"
],
"username": "system:kube-scheduler"
},
"annotations": {
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"system:kube-scheduler\" of ClusterRole \"system:kube-scheduler\" to User \"system:kube-scheduler\"",
"authorization.k8s.io/decision": "allow"
},
"stageTimestamp": "2020-12-02T15:18:52.067347Z",
"userAgent": "kube-scheduler/v1.19.4 (linux/amd64) kubernetes/d360454/leader-election",
"objectRef": {
"namespace": "kube-system",
"name": "kube-scheduler",
"apiVersion": "v1",
"resourceVersion": "2531",
"uid": "0ebf0ea5-f8c0-475a-9c9e-57674edefe8d",
"resource": "endpoints"
},
"responseObject": {
"metadata": {
"name": "kube-scheduler",
"namespace": "kube-system",
"creationTimestamp": "2020-12-02T14:36:33Z",
"annotations": {
"control-plane.alpha.kubernetes.io/leader": "{\"holderIdentity\":\"****1_938d6a87-bccb-4ea0-bd6b-31fc27e48b7a\",\"leaseDurationSeconds\":15,\"acquireTime\":\"2020-12-02T15:18:52Z\",\"renewTime\":\"2020-12-02T15:18:52Z\",\"leaderTransitions\":67}"
},
"managedFields": [
{
"operation": "Update",
"fieldsType": "FieldsV1",
"time": "2020-12-02T15:18:52Z",
"manager": "kube-scheduler",
"apiVersion": "v1",
"fieldsV1": {
"f:metadata": {
"f:annotations": {
".": {},
"f:control-plane.alpha.kubernetes.io/leader": {}
}
}
}
}
],
"resourceVersion": "2542",
"selfLink": "/api/v1/namespaces/kube-system/endpoints/kube-scheduler",
"uid": "0ebf0ea5-f8c0-475a-9c9e-57674edefe8d"
},
"apiVersion": "v1",
"kind": "Endpoints"
},
"level": "RequestResponse",
"requestReceivedTimestamp": "2020-12-02T15:18:52.062449Z",
"auditID": "a45860c7-e0c9-4724-be2e-705a1b2955f4",
"sourceIPs": [
"****"
],
"stage": "ResponseComplete",
"verb": "update"
}
],
"#timestamp": "2020-12-02T15:20:22.001Z",
"type": "json",
"metadata": {},
"kind": "EventList"
}
(I removed some personnal data from the JSONs)
Both JSONs appears as valid. I noticed that the JSONs with responseStatus.code = 201 were correctly processed, and those with code = 200 were throwing this error.
I'm getting a bit mad so if anyone can help with that, I'd be very pleased !
The error is thrown on this line because subfields has a length of 0 and hence it is trying to access index -1, which is not allowed.
The method that splits the field names into pathsis called splitAndValidatePath and what it does is to split field names when it encounters . (i.e. a dot).
In your second document, you have two fields called "." (i.e. it is just a dot) and they are not really valid.
".": {},
If you remove them both, your document will be indexed correctly.
Another way of solving this is to disable indexing for the parent f:annotations object field and that will do the trick... provided, of course, you don't need to search for content within f:annotations.
I face same problem with fluentd.
As per #val suggestion. Fixed by below.
PUT /[index_name]/_mapping
{
"properties" : {
"metadata" : {
"properties" : {
"managedFields" : {
"properties" : {
"fieldsV1" : {
"properties" : {
"f:metadata" : {
"type" : "object",
"enabled": false
}
}
}
}
}
}
}
}
}
We have JIRA triggering Jenkins builds using jira-trigger plugin of Jenkins. AS of yesterday(2019-07-10) it was all working but today it is not triggering any builds.
I have enabled following logging (to all) in Jenkins and checked the logs
*com.ceilfors.jenkins.plugins.jiratrigger.*
com.ceilfors.jenkins.plugins.jiratrigger.webhook.JiraWebhook
com.ceilfors.jenkins.plugins.jiratrigger.JiraCommentTrigger
com.ceilfors.jenkins.plugins.jiratrigger.JiraTrigger
com.ceilfors.jenkins.plugins.jiratrigger.JiraTriggerExecutor*
I could see Jira webhook is sending valid JSON and same is failing at Jenkins stating this error: org.codehaus.jettison.json.JSONException: JSONObject["name"] not found.
Error while serving https://localhost/jira-trigger-webhook-receiver/
org.codehaus.jettison.json.JSONException: JSONObject["name"] not found.
at org.codehaus.jettison.json.JSONObject.get(JSONObject.java:360)
at org.codehaus.jettison.json.JSONObject.getString(JSONObject.java:487)
at com.atlassian.jira.rest.client.internal.json.JsonParseUtil.parseBasicUser(JsonParseUtil.java:192)
at com.atlassian.jira.rest.client.internal.json.CommentJsonParser.parse(CommentJsonParser.java:37)
at com.atlassian.jira.rest.client.internal.json.CommentJsonParser$parse.call(Unknown Source)
at com.ceilfors.jenkins.plugins.jiratrigger.webhook.WebhookCommentEventJsonParser.parse(WebhookCommentEventJsonParser.groovy:40)
at com.ceilfors.jenkins.plugins.jiratrigger.webhook.WebhookCommentEventJsonParser$parse.call(Unknown Source)
at com.ceilfors.jenkins.plugins.jiratrigger.webhook.JiraWebhook.processEvent(JiraWebhook.groovy:71)
at com.ceilfors.jenkins.plugins.jiratrigger.webhook.JiraWebhook$processEvent.callCurrent(Unknown Source)
at com.ceilfors.jenkins.plugins.jiratrigger.webhook.JiraWebhook.doIndex(JiraWebhook.groovy:51)
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
Caused: java.lang.reflect.InvocationTargetException
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:400)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:77)
at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
at org.kohsuke.stapler.IndexDispatcher.dispatch(IndexDispatcher.java:27)
JSON Received:
{
"timestamp": 1562845569917,
"webhookEvent": "comment_created",
"comment": {
"self": "https://my.atlassian.net/rest/api/2/issue/12815/comment/19186",
"id": "19186",
"author": {
"self": "https://my.atlassian.net/rest/api/2/user?accountId=1234567890",
"accountId": "1234567890",
"emailAddress": "\"?\"",
"avatarUrls": {
"48x48": "https://alocal.net/initials/PM-1.png?size=48&s=48",
"24x24": "https://alocal.net/initials/PM-1.png?size=24&s=24",
"16x16": "https://alocal.net/initials/PM-1.png?size=16&s=16",
"32x32": "https://alocal.net/initials/PM-1.png?size=32&s=32"
},
"displayName": "admin",
"active": true,
"timeZone": "Asia/Calcutta",
"accountType": "atlassian"
},
"body": "deploy_staging",
"updateAuthor": {
"self": "https://my.atlassian.net/rest/api/2/user?accountId=1234567890",
"accountId": "1234567890",
"emailAddress": "\"?\"",
"avatarUrls": {
"48x48": "https://alocal.net/initials/PM-1.png?size=48&s=48",
"24x24": "https://alocal.net/initials/PM-1.png?size=24&s=24",
"16x16": "https://alocal.net/initials/PM-1.png?size=16&s=16",
"32x32": "https://alocal.net/initials/PM-1.png?size=32&s=32"
},
"displayName": "admin",
"active": true,
"timeZone": "Asia/Calcutta",
"accountType": "atlassian"
},
"created": "2019-07-11T17:16:09.917+0530",
"updated": "2019-07-11T17:16:09.917+0530",
"jsdPublic": true
},
"issue": {
"id": "12815",
"self": "https://my.atlassian.net/rest/api/2/issue/12815",
"key": "DEVOPS-160",
"fields": {
"summary": "Deploy - Test",
"issuetype": {
"self": "https://my.atlassian.net/rest/api/2/issuetype/10081",
"id": "10081",
"description": "",
"iconUrl": "https://my.atlassian.net/secure/viewavatar?size=medium&avatarId=10304&avatarType=issuetype",
"name": "Deployment",
"subtask": false,
"avatarId": 10304
},
"project": {
"self": "https://my.atlassian.net/rest/api/2/project/10032",
"id": "10032",
"key": "DEVOPS",
"name": "Test Ops",
"projectTypeKey": "software",
"simplified": false,
"avatarUrls": {
"48x48": "https://my.atlassian.net/secure/projectavatar?pid=10032&avatarId=10517",
"24x24": "https://my.atlassian.net/secure/projectavatar?size=small&s=small&pid=10032&avatarId=10517",
"16x16": "https://my.atlassian.net/secure/projectavatar?size=xsmall&s=xsmall&pid=10032&avatarId=10517",
"32x32": "https://my.atlassian.net/secure/projectavatar?size=medium&s=medium&pid=10032&avatarId=10517"
},
"projectCategory": {
"self": "https://my.atlassian.net/rest/api/2/projectCategory/10006",
"id": "10006",
"description": "Operations",
"name": "Operations"
}
},
"assignee": {
"self": "https://my.atlassian.net/rest/api/2/user?accountId=1234567890",
"name": "phani.k",
"key": "phani.k",
"accountId": "1234567890",
"emailAddress": "phani.k#synup.com",
"avatarUrls": {
"48x48": "https://alocal.net/1234567890/dfe77db8-e320-4c3e-a074-3d79892a5c6d/128?size=48&s=48",
"24x24": "https://alocal.net/1234567890/dfe77db8-e320-4c3e-a074-3d79892a5c6d/128?size=24&s=24",
"16x16": "https://alocal.net/1234567890/dfe77db8-e320-4c3e-a074-3d79892a5c6d/128?size=16&s=16",
"32x32": "https://alocal.net/1234567890/dfe77db8-e320-4c3e-a074-3d79892a5c6d/128?size=32&s=32"
},
"displayName": "admin",
"active": true,
"timeZone": "Asia/Kolkata",
"accountType": "atlassian"
},
"priority": {
"self": "https://my.atlassian.net/rest/api/2/priority/3",
"iconUrl": "https://my.atlassian.net/images/icons/priorities/medium.svg",
"name": "Medium",
"id": "3"
},
"status": {
"self": "https://my.atlassian.net/rest/api/2/status/10118",
"description": "Run all feasibility checks",
"iconUrl": "https://my.atlassian.net/",
"name": "In Progress",
"id": "10118",
"statusCategory": {
"self": "https://my.atlassian.net/rest/api/2/statuscategory/4",
"id": 4,
"key": "indeterminate",
"colorName": "yellow",
"name": "In Progress"
}
}
}
}
}
I'm trying to find the last password change date. I see it in the admin console when editing a user:
However, none of the metadata listings show an entry for the last password change date: https://developers.google.com/admin-sdk/directory/v1/guides/manage-users
{
"kind": "directory#users",
"users": [
{
"kind": "directory#user",
"id": "the unique user id",
"primaryEmail": "liz#example.com",
"name": {
"givenName": "Liz",
"familyName": "Smith",
"fullName": "Liz Smith"
},
"isAdmin": true,
"isDelegatedAdmin": false,
"lastLoginTime": "2013-02-05T10:30:03.325Z",
"creationTime": "2010-04-05T17:30:04.325Z",
"agreedToTerms": true,
"hashFunction: "SHA-1",
"suspended": false,
"changePasswordAtNextLogin": false,
"ipWhitelisted": false,
"ims": [
{
"type": "work",
"protocol": "gtalk",
"im": "lizim#talk.example.com",
"primary": true
}
],
"emails": [
{
"address": "liz#example.com",
"type": "work",
"customType": "",
"primary": true
}
],
"addresses": [
{
"type": "work",
"customType": "",
"streetAddress": "1600 Amphitheatre Parkway",
"locality": "Mountain View",
"region": "CA",
"postalCode": "94043"
}
],
"externalIds": [
{
"value": "employee number",
"type": "custom",
"customType": "office"
}
],
"relations": [
{
"value": "susan",
"type": "friend",
"customType": ""
}
],
"organizations": [
{
"name": "Google Inc.",
"title": "SWE",
"primary": true,
"customType": "",
"description": "Software engineer"
}
],
"phones": [
{
"value": "+1 nnn nnn nnnn",
"type": "work"
}
],
"aliases": [
"lizsmith#example.com",
"lsmith#example.com"
],
"nonEditableAliases: [
"liz#test.com"
],
"customerId": "C03az79cb",
"orgUnitPath": "corp/engineering",
"isMailboxSetup": true,
"includeInGlobalAddressList": true
},
{
"kind": "directory#user",
"id": "user unique ID",
"primaryEmail": "admin2#example.com",
"name": {
"givenName": "admin",
"familyName": "two",
"fullName": "admin two"
},
"isAdmin": true,
"isDelegatedAdmin": true,
"lastLoginTime": "2013-02-05T10:30:03.325Z",
"creationTime": "2010-04-05T17:30:04.325Z",
"agreedToTerms": true,
"hashFunction: "SHA-1",
"suspended": true,
"suspensionReason": "ADMIN",
"changePasswordAtNextLogin": false,
"ipWhitelisted": false,
"emails": [
{
"address": "admin2#example.com",
"type": "work",
"customType": "",
"primary": true
}
],
"externalIds": [
{
"value": "contractor license number",
"type": "custom",
"customType": "work"
}
],
"relations": [
{
"value": "liz",
"type": "friend",
"customType": ""
}
],
"aliases": [
"second_admin#example.com"
],
"nonEditableAliases: [
"admin#test.com"
],
"customerId": "C03az79cb",
"orgUnitPath": "corp/engineering",
"isMailboxSetup": true,
"includeInGlobalAddressList": true
}
],
"nextPageToken": "next page token"
}
I'm specifically using C# and the google apps directory API.
Anyone know where this field is located and/or how to access it?