Forums

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

XSRF check failed when i add project in my application

Maissa Tr
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!
June 3, 2023

Hello i try to create a project from my application but it doesn't work always show me "XSRF check failed" 

i also try to disable the XSRF but it is blocked 

and this is my code in angularr 
PLZZZZZ help me 

    const api = 'https://***.atlassian.net/rest/api/3/project';
    const email = '';
    const apiToken = '';
   
    const headers = new HttpHeaders({
      'Accept': 'application/json',
      'Content-Type': 'application/json',
      'X-Atlassian-Token': 'nocheck' ,
      'X-Requested-With': 'XMLHttpRequest',
      'Authorization': `Basic ${btoa(`${email}:${apiToken}`)}`
 
    });
   
    const bodyData = JSON.stringify({
      assigneeType: 'PROJECT_LEAD',
      description: 'Cloud migration initiative',
      issueSecurityScheme: 10001,
      key: 'EXMP',
      leadAccountId: '***',
      name: 'Example',
      permissionScheme: 10011,
      projectTemplateKey: 'com.pyxis.greenhopper.jira:gh-simplified-agility-scrum',
      projectTypeKey: 'software',
      url: 'http://atlassian.com'
    });
 
 
 
 
    this.http.post(api, bodyData, { headers: headers , withCredentials: true })
    .subscribe(
      (response: any) => {
        console.log(response);
      },
      (error: any) => {
        console.error(error);
      }
    );

image.pngimage.png

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events