Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Add comment to Jira issue via rest api

Dimitrios Danampasis
Contributor
March 10, 2023
I am writing a script in python to update Jira issues with a dynamic comment but I am getting the following error:
AttributeError: 'bytes' object has no attribute 'dumps'
This is part of the code that is failing:
mycomment = "Test comment"
issue_comment = json.dumps( {

    "body": {

        "content": [

        {

            "content": [

            {

                "text": mycomment,

                "type": "text"

            }

            ],

            "type": "paragraph"

        }

        ],

        "type": "doc",

        "version": 1

    }

})

Can you help me with how to pass a variable in this python dictionary? 

1 answer

1 accepted

1 vote
Answer accepted
Tugba Capaci
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.
March 10, 2023

Hi @Dimitrios Danampasis ,

Sounds like it is about decoding. You can check the link here, it might help.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events