Hello,
I'm trying to configure a set of automation rules to keep synchronized issues between 2 cloud instances.
One of my goals is to retrieve a comment body and a comment author from a webhook payload. I've tried {{webhookData.comment.body}} and {{webhookData.comment.author.displayName}} without any luck.
At the moment I'm only trying to log the data on the receiving instance's rule:
Any help on these will be much appreciated.
Thanks!
Hello @Pablo Serra ,
Not knowing how you have configured the "source" rule (the one triggered on issue commented event) I cannot say much on why you get an empty body.
However, I have tried to do something similar on my end, and I can actually get the right values in the request body by doing the following:
By configuring the source rule as above, I get the below payload when adding a comment to an issue in the specific project:
{
comment: {
"id" : "10533"
"body" : "TEST COMMENT - SOME RANDOM TEXT"
"author" {
"accountId" : "557XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX24c"
"displayName": "Dario B"
}
}
}
You will then be able to access the different valued from the above body by using:
You can off course further customize the body to be sent in order to include other properties like the issue key or id and any other information you desire to receive.
Please test this and let me know if it helps.
Cheers,
Dario
Hi Dario!
Trying to do the same, but on the Server version:
{
comment: {
"id" : "{{comment.last.id}}"
"body" : "{{comment.last.body}}"
"author" {
"accountId" : "{{comment.last.author}}"
"displayName": "{{comment.last.author.displayName}}"
}
}
}
Receiving 500-th error with such context :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>500</status-code><message>Unexpected character ('c' (code 99)): was expecting double-quote to start field name at [Source: org.apache.catalina.connector.CoyoteInputStream@4e98ea29; line: 2, column: 6]
If it's edited in this way
{
"issue.last.comment": {
"id" : "{{comment.last.id}}"
"body" : "{{comment.last.body}}"
"author" {
"accountId" : "{{comment.last.author}}"
"displayName": "{{comment.last.author.displayName}}"
}
}
}
I receive such code:
Unexpected character ('"' (code 34)): was expecting comma to separate OBJECT entries at [Source: org.apache.catalina.connector.CoyoteInputStream@26ab28e4; line: 4, column: 6]
Can you help me to understand this issue?
Thanks in advice
Anastasia.
Not actual - solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.