MailChimp Ecommerce order input via API is not showing in activity feed - mailchimp

I am setting up API calls to get Squarespace ecommerce products/customers/orders into Mailchimp. I specifically need the transactions to show up in the 'Activity Feed' on a customer's account, but I haven't found any documentation or answers on how to do this. The orders are adding to the 'Total Revenue' box, but not showing up on the activity feed. Screenshot attached.
So far I've fiddled around with several options in Postman. I'm trying to figure out how to make the call work before I integrate it into the rest of my code. I've read through all of the ecommerce documentation on MailChimp's site. The orders documentation is linked below.
https://mailchimp.com/developer/reference/ecommerce-stores/ecommerce-orders/
Here's what I'm sending via Postman:
Post URL: https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/orders
Body: {"id": "SAROrd000003",
"customer": {"id": "SAR000001"},
"currency_code": "USD",
"order_total": "50.00",
"lines": [{"id": "misc", "product_id": "misc", "product_variant_id":"none","quantity":1,"price":"50.00"}]
}
Here's the response I'm getting from Postman
{
"id": "SAROrd000003",
"customer": {
"id": "SAR000001",
"email_address": "sargent.jessica.b#gmail.com",
"opt_in_status": false,
"company": "",
"first_name": "",
"last_name": "",
"orders_count": 3,
"total_spent": 150,
"address": {
"address1": "",
"address2": "",
"city": "",
"province": "",
"province_code": "",
"postal_code": "",
"country": "",
"country_code": ""
},
"created_at": "2019-11-27T00:52:34+00:00",
"updated_at": "2019-11-27T02:38:51+00:00",
"_links": [
{
"rel": "self",
"href": "https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/customers/SAR000001",
"method": "GET",
"targetSchema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Customers/Response.json"
},
{
"rel": "parent",
"href": "https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/customers",
"method": "GET",
"targetSchema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Customers/CollectionResponse.json"
},
{
"rel": "update",
"href": "https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/customers/SAR000001",
"method": "PATCH",
"targetSchema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Customers/Response.json",
"schema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Customers/PATCH.json"
},
{
"rel": "upsert",
"href": "https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/customers/SAR000001",
"method": "PUT",
"targetSchema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Customers/Response.json",
"schema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Customers/PUT.json"
},
{
"rel": "delete",
"href": "https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/customers/SAR000001",
"method": "DELETE"
}
]
},
"store_id": "test_store",
"campaign_id": "",
"landing_site": "",
"financial_status": "",
"fulfillment_status": "",
"currency_code": "USD",
"order_total": 50,
"order_url": "",
"discount_total": 0,
"tax_total": 0,
"shipping_total": 0,
"tracking_code": "",
"processed_at_foreign": "",
"cancelled_at_foreign": "",
"updated_at_foreign": "",
"shipping_address": {
"name": "",
"address1": "",
"address2": "",
"city": "",
"province": "",
"province_code": "",
"postal_code": "",
"country": "",
"country_code": "",
"longitude": 0,
"latitude": 0,
"phone": "",
"company": ""
},
"billing_address": {
"name": "",
"address1": "",
"address2": "",
"city": "",
"province": "",
"province_code": "",
"postal_code": "",
"country": "",
"country_code": "",
"longitude": 0,
"latitude": 0,
"phone": "",
"company": ""
},
"lines": [
{
"id": "misc",
"product_id": "misc",
"product_title": "misc",
"product_variant_id": "none",
"product_variant_title": "none",
"quantity": 1,
"price": 50,
"discount": 0,
"_links": [
{
"rel": "self",
"href": "https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/orders/SAROrd000003/lines/misc",
"method": "GET",
"targetSchema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Orders/Lines/Response.json"
},
{
"rel": "parent",
"href": "https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/orders/SAROrd000003",
"method": "GET",
"targetSchema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Orders/Lines/CollectionResponse.json"
},
{
"rel": "update",
"href": "https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/orders/SAROrd000003/lines/misc",
"method": "PATCH",
"targetSchema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Orders/Lines/Response.json",
"schema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Orders/Lines/PATCH.json"
},
{
"rel": "delete",
"href": "https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/orders/SAROrd000003/lines/misc",
"method": "DELETE"
}
]
}
],
"_links": [
{
"rel": "self",
"href": "https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/orders/SAROrd000003",
"method": "GET",
"targetSchema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Orders/Response.json"
},
{
"rel": "parent",
"href": "https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/orders",
"method": "GET",
"targetSchema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Orders/CollectionResponse.json"
},
{
"rel": "update",
"href": "https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/orders/SAROrd000003",
"method": "PATCH",
"targetSchema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Orders/Response.json",
"schema": "https://us12.api.mailchimp.com/schema/3.0/Definitions/Ecommerce/Stores/Orders/PATCH.json"
},
{
"rel": "delete",
"href": "https://us12.api.mailchimp.com/3.0/ecommerce/stores/test_store/orders/SAROrd000003",
"method": "DELETE"
}
]
}

I spoke with someone on their API team. submitting an order date in ISO-8601 format into the "processed_at_foreign" param solved the problem.

Related

Microsoft Graph Batch API concurrent request reduction to 4 where as outlook had 200 concurrent Requests

We use Outlook Batch API to send multiple Outlook REST requests in a single HTTP batch request. In Outlook Batch API, we make 200 requests in the same batch HTTP request and all the concurrent requests succeed. Whereas if we do the same in graph API, only 4 concurrent requests succeed as only 4 concurrent requests are supported in graph APIs (attached request and response).
We have the cases such as 10000 events creating at once(like users can add/remove 10000 items from a single user calendar).
So it would be of great help if the Graph APIs batch limit is set to be same as Outlook API(200 concurrent request).
Sample request:
{
"requests": [
{
"url": "/me/calendars",
"method": "POST",
"id": "1",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test1s"
}
},
{
"url": "/me/calendars",
"method": "POST",
"id": "2",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test2"
}
},
{
"url": "/me/calendars",
"method": "POST",
"id": "3",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test3"
}
},
{
"url": "/me/calendars",
"method": "POST",
"id": "4",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test4"
}
},
{
"url": "/me/calendars",
"method": "POST",
"id": "5",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test5s"
}
},
{
"url": "/me/calendars",
"method": "POST",
"id": "6",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test6s"
}
},
{
"url": "/me/calendars",
"method": "POST",
"id": "7",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test7s"
}
}
]
}
Response:
{
"responses": [
{
"id": "6",
"status": 429,
"headers": {
"Retry-After": "1",
"Cache-Control": "private",
"Content-Type": "application/json"
},
"body": {
"error": {
"code": "ApplicationThrottled",
"message": "Application is over its MailboxConcurrency limit.",
"innerError": {
"date": "2022-08-11T06:21:56",
"request-id": "e09afe6b-25d6-4cdc-93f5-0539d6e8b9c6",
"client-request-id": "efe22070-473c-28bd-d1bf-ad43bb9f753f"
}
}
}
},
{
"id": "7",
"status": 429,
"headers": {
"Retry-After": "1",
"Cache-Control": "private",
"Content-Type": "application/json"
},
"body": {
"error": {
"code": "ApplicationThrottled",
"message": "Application is over its MailboxConcurrency limit.",
"innerError": {
"date": "2022-08-11T06:21:56",
"request-id": "e09afe6b-25d6-4cdc-93f5-0539d6e8b9c6",
"client-request-id": "efe22070-473c-28bd-d1bf-ad43bb9f753f"
}
}
}
},
{
"id": "4",
"status": 429,
"headers": {
"Retry-After": "1",
"Cache-Control": "private",
"Content-Type": "application/json"
},
"body": {
"error": {
"code": "ApplicationThrottled",
"message": "Application is over its MailboxConcurrency limit.",
"innerError": {
"date": "2022-08-11T06:21:56",
"request-id": "e09afe6b-25d6-4cdc-93f5-0539d6e8b9c6",
"client-request-id": "efe22070-473c-28bd-d1bf-ad43bb9f753f"
}
}
}
},
{
"id": "5",
"status": 201,
"headers": {
"Location": x"https://outlook.office.com/api/v2.0/Users('xxxx')/Calendars('xxxx')",
"Cache-Control": "private",
"OData-Version": "4.0",
"Content-Type": "application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8"
},
"body": {
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('xxxxx')/calendars/$entity",
"id": "xxx",
"name": "test5s",
"color": "auto",
"hexColor": "",
"isDefaultCalendar": false,
"changeKey": "xxxxx",
"canShare": true,
"canViewPrivateItems": true,
"canEdit": true,
"allowedOnlineMeetingProviders": [
"teamsForBusiness"
],
"defaultOnlineMeetingProvider": "teamsForBusiness",
"isTallyingResponses": false,
"isRemovable": true,
"owner": {
"name": "xxxx",
"address": "xxxx.onmicrosoft.com"
}
}
},
{
"id": "2",
"status": 201,
"headers": {
"Location": "https://outlook.office.com/api/v2.0/Users('xxxx')/Calendars('xxxx')",
"Cache-Control": "private",
"OData-Version": "4.0",
"Content-Type": "application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8"
},
"body": {
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('xx')/calendars/$entity",
"id": "xxx",
"name": "test2",
"color": "auto",
"hexColor": "",
"isDefaultCalendar": false,
"changeKey": "xxxxx",
"canShare": true,
"canViewPrivateItems": true,
"canEdit": true,
"allowedOnlineMeetingProviders": [
"teamsForBusiness"
],
"defaultOnlineMeetingProvider": "teamsForBusiness",
"isTallyingResponses": false,
"isRemovable": true,
"owner": {
"name": "xxxx",
"address": "xxxxx.onmicrosoft.com"
}
}
},
{
"id": "3",
"status": 201,
"headers": {
"Location": "https://outlook.office.com/api/v2.0/Users('xxxx')/Calendars('xxxxx')",
"Cache-Control": "private",
"OData-Version": "4.0",
"Content-Type": "application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8"
},
"body": {
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('xxx')/calendars/$entity",
"id": "x",
"name": "test3",
"color": "auto",
"hexColor": "",
"isDefaultCalendar": false,
"changeKey": "xxxxxx==",
"canShare": true,
"canViewPrivateItems": true,
"canEdit": true,
"allowedOnlineMeetingProviders": [
"teamsForBusiness"
],
"defaultOnlineMeetingProvider": "teamsForBusiness",
"isTallyingResponses": false,
"isRemovable": true,
"owner": {
"name": "xxxx",
"address": "xxxxxx.onmicrosoft.com"
}
}
},
{
"id": "1",
"status": 201,
"headers": {
"Location": "https://outlook.office.com/api/v2.0/Users('xxxx')/Calendars('xxxx')",
"Cache-Control": "private",
"OData-Version": "4.0",
"Content-Type": "application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8"
},
"body": {
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('xxxxx')/calendars/$entity",
"id": "xxxxxx",
"name": "test1s",
"color": "auto",
"hexColor": "",
"isDefaultCalendar": false,
"changeKey": "xxxxxxx",
"canShare": true,
"canViewPrivateItems": true,
"canEdit": true,
"allowedOnlineMeetingProviders": [
"teamsForBusiness"
],
"defaultOnlineMeetingProvider": "teamsForBusiness",
"isTallyingResponses": false,
"isRemovable": true,
"owner": {
"name": "xxxx",
"address": "xxxxx.onmicrosoft.com"
}
}
}
]
}
There is a known issue with Batching as mentioned here:
and more in this :
For reference, please refer this:
https://learn.microsoft.com/en-us/graph/known-issues#json-batching
https://learn.microsoft.com/en-us/graph/throttling#throttling-and-batching

Category is missing from outlook event from the notification

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"
}

using ansible to parse api return

I'm terribly stuck for 2 days on this. I have the below list from an api and want to print from tower with something more readable for the enduser. It should be something like a list of switches(infraAccPortP.attributes.name) and if there is a children list then a dict with key of infraHPortS.attributes.name and value infraPortBlk.attributes.fromPort
this is my first attempt at using ansible to retrieve data and manipulate it, I usually just use it to build stuff...thats easier it seems
"result.imdata": [
{
"infraAccPortP": {
"attributes": {
"annotation": "",
"childAction": "",
"descr": "",
"dn": "uni/infra/accportprof-101_102",
"extMngdBy": "",
"lcOwn": "local",
"modTs": "2020-09-10T14:18:01.362+00:00",
"monPolDn": "uni/fabric/monfab-default",
"name": "101_102",
"nameAlias": "",
"ownerKey": "",
"ownerTag": "",
"status": "",
"uid": "15374"
}
}
},
{
"infraAccPortP": {
"attributes": {
"annotation": "",
"childAction": "",
"descr": "",
"dn": "uni/infra/accportprof-101",
"extMngdBy": "",
"lcOwn": "local",
"modTs": "2020-09-10T14:18:01.775+00:00",
"monPolDn": "uni/fabric/monfab-default",
"name": "101",
"nameAlias": "",
"ownerKey": "",
"ownerTag": "",
"status": "",
"uid": "15374"
},
"children": [
{
"infraHPortS": {
"attributes": {
"annotation": "",
"childAction": "",
"descr": "",
"extMngdBy": "",
"lcOwn": "local",
"modTs": "2020-09-16T23:09:40.856+00:00",
"monPolDn": "uni/fabric/monfab-default",
"name": "test",
"nameAlias": "",
"ownerKey": "",
"ownerTag": "",
"rn": "hports-test-typ-range",
"status": "",
"type": "range",
"uid": "23110"
},
"children": [
{
"infraPortBlk": {
"attributes": {
"annotation": "",
"childAction": "",
"descr": "",
"extMngdBy": "",
"fromCard": "1",
"fromPort": "12",
"lcOwn": "local",
"modTs": "2020-09-16T23:09:40.856+00:00",
"monPolDn": "uni/fabric/monfab-default",
"name": "block2",
"nameAlias": "",
"rn": "portblk-block2",
"status": "",
"toCard": "1",
"toPort": "12",
"uid": "23110"
}
}
}
]
}
},
{
"infraHPortS": {
"attributes": {
"annotation": "",
"childAction": "",
"descr": "",
"extMngdBy": "",
"lcOwn": "local",
"modTs": "2020-09-16T13:33:07.108+00:00",
"monPolDn": "uni/fabric/monfab-default",
"name": "101_fex",
"nameAlias": "",
"ownerKey": "",
"ownerTag": "",
"rn": "hports-101_fex-typ-range",
"status": "",
"type": "range",
"uid": "23110"
},
"children": [
{
"infraRsAccBaseGrp": {
"attributes": {
"annotation": "",
"childAction": "",
"extMngdBy": "",
"fexId": "101",
"forceResolve": "yes",
"lcOwn": "local",
"modTs": "2020-09-16T13:33:07.108+00:00",
"monPolDn": "uni/fabric/monfab-default",
"rType": "mo",
"rn": "rsaccBaseGrp",
"state": "formed",
"stateQual": "none",
"status": "",
"tCl": "infraFexBndlGrp",
"tDn": "uni/infra/fexprof-101_fex/fexbundle-101_fex",
"tType": "mo",
"uid": "23110"
}
}
}
]
}
}
]
}
},
{
"infraAccPortP": {
"attributes": {
"annotation": "",
"childAction": "",
"descr": "",
"dn": "uni/infra/accportprof-102",
"extMngdBy": "",
"lcOwn": "local",
"modTs": "2020-09-10T14:18:02.163+00:00",
"monPolDn": "uni/fabric/monfab-default",
"name": "102",
"nameAlias": "",
"ownerKey": "",
"ownerTag": "",
"status": "",
"uid": "15374"
},
"children": [
{
"infraHPortS": {
"attributes": {
"annotation": "",
"childAction": "",
"descr": "",
"extMngdBy": "",
"lcOwn": "local",
"modTs": "2020-09-16T18:30:37.333+00:00",
"monPolDn": "uni/fabric/monfab-default",
"name": "test",
"nameAlias": "",
"ownerKey": "",
"ownerTag": "",
"rn": "hports-test-typ-range",
"status": "",
"type": "range",
"uid": "23110"
},
"children": [
{
"infraPortBlk": {
"attributes": {
"annotation": "",
"childAction": "",
"descr": "",
"extMngdBy": "",
"fromCard": "1",
"fromPort": "7",
"lcOwn": "local",
"modTs": "2020-09-16T18:30:37.333+00:00",
"monPolDn": "uni/fabric/monfab-default",
"name": "block2",
"nameAlias": "",
"rn": "portblk-block2",
"status": "",
"toCard": "1",
"toPort": "7",
"uid": "23110"
}
}
}
]
}
},
{
"infraHPortS": {
"attributes": {
"annotation": "",
"childAction": "",
"descr": "",
"extMngdBy": "",
"lcOwn": "local",
"modTs": "2020-09-11T15:26:44.501+00:00",
"monPolDn": "uni/fabric/monfab-default",
"name": "9k_b25b_1-32",
"nameAlias": "",
"ownerKey": "",
"ownerTag": "",
"rn": "hports-9k_b25b_1-32-typ-range",
"status": "",
"type": "range",
"uid": "23110"
},
"children": [
{
"infraPortBlk": {
"attributes": {
"annotation": "",
"childAction": "",
"descr": "",
"extMngdBy": "",
"fromCard": "1",
"fromPort": "48",
"lcOwn": "local",
"modTs": "2020-09-11T15:26:44.501+00:00",
"monPolDn": "uni/fabric/monfab-default",
"name": "block2",
"nameAlias": "",
"rn": "portblk-block2",
"status": "",
"toCard": "1",
"toPort": "48",
"uid": "23110"
}
}
}
]
}
}
]
}
}
]
}
Expected results would look something like:
switch: 101
ports:
- srvName: test
port: 12
- srvName: test2
port:13
switch: 102
ports:
- srvName: test3
port: 12
- srvName: test4
port:13
Q: "List of switches(infraAccPortP.attributes.name)"
A: The task below
- debug:
msg: "{{ result.imdata|json_query('[].*.*.name')|flatten }}"
gives
msg:
- '101_102'
- '101'
- '102'

jira-trigger-webhook-receiver throws JSONException: JSONObject["name"] not found

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"
}
}
}
}
}

i18n is not working in sapui5. (wp8)

My i18n is not working, I don't know what is wrong, below my manifest.json:
{
"_version": "1.1.0",
"sap.app": {
"_version": "1.1.0",
"id": "de.pensware.ui5StocksApp",
"type": "application",
"i18n": "i18n/i18n.properties"
},
"sap.ui": {
"technology": "UI5",
"icons": {
"icon": "",
"favIcon": "",
"phone": "",
"phone#2": "",
"tablet": "",
"tablet#2": ""
},
"deviceTypes": {
"desktop": true,
"tablet": true,
"phone": true
},
"supportedThemes": [
"sap_bluecrystal"
]
},
"sap.ui5": {
"_version": "1.1.0",
"rootView": {
"viewName": "de.pensware.ui5StocksApp.view.App",
"type": "XML"
},
"dependencies": {
"minUI5Version": "1.30.0",
"libs": {
"sap.ui.core": {},
"sap.m": {},
"sap.ui.layout": {}
}
},
"contentDensities": {
"compact": true,
"cozy": true
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "de.pensware.ui5StocksApp.i18n.i18n"
}
}
},
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"viewType": "XML",
"viewPath": "de.pensware.ui5StocksApp.view",
"controlId": "app",
"controlAggregation": "pages",
"transition": "slide"
},
"routes": [{
"name": "login",
"pattern": "",
"target": "login"
}],
"targets": {
"login": {
"viewName": "Login",
"viewId": "Login"
}
}
}
}
}
In my aplication I have a folder called i18n and the i18n.properties file.
In My view I have :
<Page title="{i18n>appTitle}">
But when I execute the app in a mobile windows phone it's not showing me the corresponding text traslation, it is showing only "appTitle" value.

Resources