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
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.

Register now
AUG Leaders

Atlassian Community Events