Forums

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

Programatically create issue in JIRA from Angular 8

Mahesh Sherkar May 19, 2020

Hi,
I don't have any idea about JIRA. I only heard JIRA is issue tracking tool that's it.
We've developed Angular8 site which is hosted in Sharepoint online - Microsoft Office365 environment,  now on my site if there is any issue on any site pages then it should programmatically log issue/defect/bug in JIRA (JIRA is hosted on AWS-amazon web services). Project is already created in jira , i just want to create issue under that project.
Is there any way to do so using REST URL or anything?
Your help will greatly appreciated. 

Thanks,
Mahesh S

2 answers

3 votes
Vikrant Yadav
Community Champion
May 20, 2020

Hi @Mahesh Sherkar  Yes you can create an issue in JIRA using Rest API . Please go through this link :- https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-create-issue-7897248/

Mahesh Sherkar May 21, 2020

@Vikrant Yadav :- By using above link i've written one function which will perform Rest Post to Jira site from my Sharepoint site. When i perform Post operation it is giving me below error:- 

Status Code: 403 error
Response Text: XSRF check failed

But from Postmen tool by using same Rest Post url, its working fine.
Could you please suggest  some solution?
Your assistance would be greatly appreciated!

Note:- 
1) My Sharepoint online site is in Office365 environment
2) Jira site is hosted in AWS (Amazon web service platform)
3) Im using Basic Authentication 

Vikrant Yadav
Community Champion
May 21, 2020

hi @Nic Brough -Adaptavist-  can you please suggest on above query. I am not sure about this. 

Thanks

Vikrant 

Mahesh Sherkar May 21, 2020

@Nic Brough -Adaptavist-  , @Vikrant Yadav  :- Do i need to whitelist my sharepoint site in Jira for all the incoming connection?

Configuring the Whitelist:-
https://confluence.atlassian.com/doc/configuring-the-whitelist-381255821.html
https://confluence.atlassian.com/adminjiraserver073/configuring-the-whitelist-861254007.html

I do not have rights in Jira for configuration changes. 
What is your view on this?

Mahesh Sherkar June 26, 2020

I’ve whitelisted my sharepoint site in Jira cloud site still i’m getting below CORS error. I gone through many articles but nothing works.

Error:-
“Access to XMLHttpRequest at ‘https://mysite.atlassian.net/rest/api/2/issue’ from origin ‘https://ABCD.sharepoint.com/’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is ------present on the requested resource.”

-----------------------------------------------------------

Is it possible to resolve above error using frontend programming like Angular8 Or Shall i use backend programming like node.js etc because its crossdomain call?

Your help with this would be greatly appreciated.

Thanks,
Mahesh S

Vikrant Yadav
Community Champion
June 27, 2020

Hi @Mahesh Sherkar  for this error you need to involve network team or you can drop an email or create support ticket under Atlassian for proper resolution. Atlassian can guide you in right direction.

 

Thanks

0 votes
Jatinder kumar
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 19, 2022

Hi, i am also facing same Cors issue while making a post request(Basic auth) from Angular 8 project. do you have any workaround for this Cross-domain issue ? please share.

Nic Brough -Adaptavist-
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.
June 19, 2022

You need to adjust your code to make the right call with the right headers, or fix the network from which the code is making the call to Jira.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events