1
을 함께 JIRA 문제를 업데이트 할 수 없습니다,하지만 난 400 오류 받고 있어요 : 내가 요청에서 "몸"을 제거하고 그것을 변경하는 경우는 REST API를 내가 PowerShell을 사용하여이 작업을 수행하기 위해 노력하고있어
$RESTURL = 'https://mycomp.atlassian.net/rest/api/latest/issue/PROJ-61'
$body = '{"fields":{"assignee":{"name":"me"}}}'
$restcreds = [System.Convert]::ToBase64String(
[System.Text.Encoding]::ASCII.GetBytes(('me' + ":" + 'mypass123'))
)
$httpheader = @{Authorization = "Basic $restcreds"}
$restParameters = @{
Uri = $RESTURL;
ContentType = "application/json";
Method = "PUT";
Headers = $httpheader;
Body = $body;
}
Invoke-RestMethod @restParameters
을 나는 데이터를 성공적으로 다시 얻는다. 방금 티켓을 수정하는 것 같습니다.
요청 본문에 아무런 문제가 없었습니다. 문제는 "나"라는 양수인이 존재하지 않았다는 것입니다 (오타가 있었음). 그리고 내가 요청한 본문을 출력하도록 PS를 얻는 방법을 설명하는이 SO 질문을 발견했습니다. (오류를 발견 한 방법입니다) http://stackoverflow.com/questions/18771424/how-to-get-powershell-invoke-restmethod-to -return-body-of-http-500-code-response – red888