Forums

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

jira server web api unauthorized using

taghizad
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!
May 30, 2019

hello

i used the below code(using Atlassian.Jira library for C#) to create issue in my local Jira Server:

Jira jira= Jira.CreateRestClient("https://jira.mycompany.com", Email, password);
Issue mmm= jira.CreateIssue(ProjectKey);
mmm.Summary = summery;
mmm.Description = description;
mmm.Type = new IssueType("", issuetype);
mmm.SaveChanges();

 

when savechanges called the below error occured:

401 unauthorized

 

with this url jira.mycompany.com/rest/api/2/issue/createmeta

i have received this text:

{"expand":"projects","projects":[{"self":"https://jira.mycompany.com/rest/api/2/project/12214","id":"12214","key":"APMDAP","name":"DAP","avatarUrls":{"48x48":"https://jira.mycompany.com/secure/projectavatar?avatarId=10324","24x24":"https://jira.mycompany.com/secure/projectavatar?size=small&avatarId=10324","16x16":"https://jira.mycompany.com/secure/projectavatar?size=xsmall&avatarId=10324","32x32":"https://jira.mycompany.com/secure/projectavatar?size=medium&avatarId=10324"},"issuetypes":[{"self":"https://jira.mycompany.com/rest/api/2/iss... sub-task of the issue","iconUrl":"https://jira.mycompany.com/secure/viewavatar?size=xsmall&avatarId=10316&avatarType=issuetype","name":"Sub-task","subtask":true},{"self":"https://jira.mycompany.com/rest/api/2/issuetype/10001","id":"10001","description":"Created by Jira Software - do not edit or delete. Issue type for a user story.","iconUrl":"https://jira.mycompany.com/images/icons/issuetypes/story.svg","name":"Story","subtask":false},{"self":"https://jira.mycompany.com/rest/api/2/issuetype/10200","id":"10200","description":"A problem which impairs or prevents the functions of the product.","iconUrl":"https://jira.mycompany.com/secure/viewavatar?size=xsmall&avatarId=10303&avatarType=issuetype","name":"Bug","subtask":false},{"self":"https://jira.mycompany.com/rest/api/2/issuetype/10000","id":"10000","description":"Created by Jira Software - do not edit or delete. Issue type for a big user story that needs to be broken down.","iconUrl":"https://jira.mycompany.com/images/icons/issuetypes/epic.svg","name":"Epic","subtask":false}]},{"self":"https://jira.mycompany.com/rest/api/2/project/10201","id":"10201","key":"TDL","name":"To Do List","avatarUrls":{"48x48":"https://jira.mycompany.com/secure/projectavatar?pid=10201&avatarId=10330","24x24":"https://jira.mycompany.com/secure/projectavatar?size=small&pid=10201&avatarId=10330","16x16":"https://jira.mycompany.com/secure/projectavatar?size=xsmall&pid=10201&avatarId=10330","32x32":"https://jira.mycompany.com/secure/projectavatar?size=medium&pid=10201&avatarId=10330"},"issuetypes":[{"self":"https://jira.mycompany.com/rest/api/2/issuetype/10100","id":"10100","description":"A task that needs to be done.","iconUrl":"https://jira.mycompany.com/secure/viewavatar?size=xsmall&avatarId=10318&avatarType=issuetype","name":"Task","subtask":false},{"self":"https://jira.mycompany.com/rest/api/2/issuetype/10101","id":"10101","description":"The sub-task of the issue","iconUrl":"https://jira.mycompany.com/secure/viewavatar?size=xsmall&avatarId=10316&avatarType=issuetype","name":"Sub-task","subtask":true}]}]}

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events