Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Custom Endpoint to Jira wierd issue 403 error

serge calderara
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.
August 5, 2021

Dear all,

I have define a custom endpoint in script runner to be called from an external application

The custom enpoint is defined as below :

UpdateStatus2(httpMethod: "POST",groups:["sg-app-rlx-atlassian-adm"]) { MultivaluedMap queryParams, String body ->

CommentManager commentManager = ComponentAccessor.getCommentManager()
IssueManager issueManager = ComponentAccessor.getIssueManager()
JsonSlurper jsonSlurper = new JsonSlurper()

String JobStatusValue = jsonSlurper.parseText(body).JobStatus
//String JobIdValue=jsonSlurper.parseText(body).JobId
//String RunBookNameValue=jsonSlurper.parseText(body).RunBookName

def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchService = ComponentAccessor.getComponent(SearchService)

// edit this query to suit
//def query = jqlQueryParser.parseQuery("project = 'Technical Service Desk' AND issuetype = 'Flush AEM Internal Cache' AND 'Azure Automation Job Id' ~ " + JobIdValue)
def query = jqlQueryParser.parseQuery("project = 'Technical Service Desk' AND issuetype = 'Flush AEM Internal Cache' AND status='In Progress'")
def search = searchService.search(user, query, PagerFilter.getUnlimitedFilter())

//search.results.each { documentIssue ->
//log.debug(documentIssue.key)
Issue issue =issueManager.getIssueObject(search.results.first().key)
// Issue issue =issueManager.getIssueObject(documentIssue.key)
commentManager.create(issue, issue.getAssignee(), "Job status has change to $JobStatusValue",true)
//}


return Response.ok().build()
}

 

What is happening is that if hit the endpoint from PostMan by using corresponding user/passw for Basic Auth on the request, then it is working fine without trouble.

 

When I ask my customer to hit the same Enpoint using same user/password for Basic Authentication, then he receive a 403 error

Any idea what is  wrong and why external user cannot hit the endpoint using postman without error?

regards

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 5, 2021

Hi @serge calderara , it must be wrong request sent by your customer. I would check his request and compare it with your request. Can you share your postman and your customer's postmand screenshots?

serge calderara
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.
August 5, 2021

hello @Martin Bayer _MoroSystems_ s_r_o__ , I have configure myself the postman request at customer site remotely so I am 100% sure it is the same.

The only difference between is the network infrastructure only 

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 5, 2021

I am not networking expert but maybe some network device in a chain is changing headers in outcomming http request? Can you check with them?

And did yo use postman or dofferent client at customer site?

serge calderara
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.
August 5, 2021

we solve it, it was due to cookies

TAGS
AUG Leaders

Atlassian Community Events