Forums

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

403 error on post method with angular

Antoine Lucchini
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 9, 2022

I try to create new task or stroy on my jira project but when I used post method an error 403 spawn. I have this error with my Angular code but with Postman it works perfectly.

In angular, I have no problem with get method.

 

let jiraTemplate = {

          "fields": 

          {

            "project": {

              "key": "JIR"

            },

            "summary": "test",

            "description": {

              "version": 1,

              "type": "doc",

              "content": [

                {

                  "type": "paragraph",

                  "content": [

                    {

                      "type": "text",

                      "text": "description",

                    }

                  ]

                }

              ]

            },

            "issuetype": {

              "name": "Story",

            }

          }

        }

      }

    });

    const url = 'https://<myWebSite>.atlassian.net/rest/api/3/issue/'

    const header = new HttpHeaders({

      'Authorization': 'Basic ' + btoa("<login>:<token>"),

      'Accept': 'application/json',

      'Content-Type': 'application/json;charset=UTF-8',

    });

    const option = {headers: header}

    this.http.post(urlJSON.stringify(jiraTemplate), option)

    .subscribe(data => {

      console.log('🚀 ~ data'data);

    })

 

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events