Sending HMTL code over Jira automation webhook, How do i get it to render?

Osaid Khilfeh August 18, 2023

Hi all,

I'm automating some jira tasks using Project automation by sending a POST request to a webhook they provide me. In that request, I'm sending some HTML code as additional data to populate the description. 

My description in the rule is just: {{webhookjson.template}}. I've been able to send the code over just fine and it shows up in the tasks I've created but it just looks like code.

i've been using postman:Screenshot 2023-08-21 at 2.31.27 PM.png

This is my rule:

Screenshot 2023-08-21 at 2.36.25 PM.png

 

This is the description that shows up when the task is created:

Screenshot 2023-08-21 at 2.39.56 PM.png

 

This is what I want it to kinda look like:

Screenshot 2023-08-21 at 2.41.32 PM.png

Does anyone know I can get that code to be rendered?

Thanks,

Osaid

1 answer

1 vote
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2023

Hi @Osaid Khilfeh -- Welcome to the Atlassian Community!

For a question like this, please post images of the following to provide context.  That will help the community offer better suggestions.

  • single image of your complete rule
  • image of the specific action(s) where you are setting the description field
  • image of the audit log details showing the execution of the rule
  • image of the issue view, showing the results with the description field not working as you expect

Thanks!

Kind regards,
Bill

Osaid Khilfeh August 21, 2023

Hi @Bill Sheboy ,

I've updated my question for better context!

Thanks,

Osaid

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2023

Thanks for that information.  I do not believe that will work as the two possible field renderers can handle the wiki markup and plain text (plus HTML links). 

A few options are to:

  • change your source to plain text with placeholder tokens, and replace them in the rule with markdown / issue field data; 
  • change your source webhook to use Jira wiki markdown; or
  • investigate the Atlassian Marketplace to add additional field renderers / markdown.
Osaid Khilfeh August 21, 2023

Different but related question then: do you know how to add attachments using the webhook? I’m not sure how to.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2023

There are examples like this if you search in the developer community or in the REST API documentation.  For example:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-issue-issueidorkey-attachments-post

Osaid Khilfeh August 22, 2023

Do you know if this work when creating a new task? What you linked me seems to be for adding attachments to current tasks.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 22, 2023

My understanding is if the attachment is available by a web location or included in the message it will attach.

If that does not work, you could make the web request call after the task is created, referencing {{createdIssue.key}} as the target to add the attachment.

Suggest an answer

Log in or Sign up to answer