다음은 리치 텍스트/wiki 텍스트가 포함 된 JSON 데이터입니다. 이 데이터를 REST API를 통해 Jira의 문제 중 하나로 전달하려고합니다. 여기 자바는 내가 사용하고있는 기술이다.json의 나머지 API를 통해 Jira의 설명을 업데이트하는 방법
{"update":{"summary": [{"set": "CRF-397 – For Virgin Mobile, alert must be sent via email when Tier Mismatch exception is encountered."}]},"fields":{"description":{"set":"*Clients Impacted** Virgin Mobile *Background Information*<br>All UK schemes are experiencing at different levels some issues of:* Customers being billed on the wrong premium* Excess Fees paid at point of claim do not correspond to what has been communicated to the customer at the point of sale.* Welcome packs not being issued due to a mismatch *CRF Scope*<br>The scope of this project consists of identifying whenever a new device is communicated to Asurion by a client system and ensuring the data in each of those instances is validated to confirm that the device premium and excess fees are correctly aligned.*User Story Scope*<br>While doing enrollment if any record goes into exception due to Tier is match we have to send consolidated list of such records via email so that Asurion Team can communicate with Virgin Mobile to resolve the Tier Mismatch issues.*Requirement** An email alert must be sent when Tier Mismatch exception is encountered.* Flag based development must be done for triggering an email.* Email must be sent to Client Service, SCM and BI teams* Recipient email IDs must be configurable.* Exception list must contain below records:- * The list of devices for which there was an exception * The Feature Code sent by Virgin Mobile * The feature code configured in Client Convention for the given device*"}}}
위의 JSON은 jiraUpdateFromBuilder
에 저장하고 있습니다.
다음과 같이 Jira의 설명을 업데이트하려면 PUT
메서드를 호출합니다. 여기에 201 이외의 상태를 받고 그리고 같은 문제가 포함 JIRA에서 이슈의 모든 필드이기 때문에
String _jiraUrl = applicationProperties.get(Constants.JIRAURL)
+ "/rest/api/2/issue/" + reference;
String _jiraUser = applicationProperties.get(Constants.JIRAUSER);
String _jiraPwd = applicationProperties.get(Constants.JIRAPWD);
String auth = new String(Base64.encode(_jiraUser + ":" + _jiraPwd));
int statusCode = invokePutMethod(auth, _jiraUrl.trim(),
jiraUpdateFromBuilder.toString().trim());
public static int invokePutMethod(String auth, String url, String data) {
int statusCode = 0;
try {
Client client = Client.create();
WebResource webResource = client.resource(url);
ClientResponse response = webResource
.header("Authorization", "Basic " + auth)
.type("application/json").accept("application/json")
.put(ClientResponse.class, data);
statusCode = response.getStatus();
return statusCode;
} catch (Exception e) {
Constants.ERROR.info(Level.INFO, e);
}
return statusCode;
}
이렇게, 나는 어떤 REST API를 통해, 락스에 문제의 설명을 업데이트 할 수 없습니다입니다 서식있는 텍스트 JSON 또는 다른 방법으로 변경해야하는 경우 JRJC가 다른 도움을 줄 수 있는지 여부를 알려주세요.
어떤 오류가 발생합니까? – GlennV
이와 같이 오류가 없지만 위의 json으로 put() 메서드를 호출 한 후 상태 코드가 400으로 표시됩니다. –