Forums

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

How To Update Custom Fields via Jira API?

Randy Smith August 3, 2023

Using CFML, I'm trying to update a custom field that contains a number.  I've tried a number of variations of the body value and different versions of the URL.

Anyone have any idea what I'm setting wrong?

 

    <cfset bodyValue = '{
            "fields":{"customfield_1234":564}
        }' />
        <cfhttpparam type="header" name="Authorization" value="Basic my-encoded-key-here">
        <cfhttpparam type="header" name="Content-Type"  value="application/json">
        <cfhttpparam type="body" value="#bodyValue#">
    </cfhttp>

1 answer

1 accepted

1 vote
Answer accepted
Randy Smith August 3, 2023

Found the answer - updates like this need METHOD="PUT"

    <cfset bodyValue = '{
        "fields":{
            "customfield_12345":564
        }
    }' />
        <cfhttpparam type="header" name="Authorization" value="Basic my-encoded-key-here">
        <cfhttpparam type="header" name="Content-Type"  value="application/json">
        <cfhttpparam type="body" value="#bodyValue#">
    </cfhttp>

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events