Я работаю над разработкой веб-сервиса, который связывает два приложения друг с другом, первое приложение отправит объект json второму. Я застрял в переводе этого json объекта:
$body = "{"fields":{"project":{"key":"'+$projectKey+'"}
,"issuetype":{"name": "'+$issueType+'"}
,"summary":"'+$summary+'"
,"description":"'+$description+'"
,"customfield_12721":"'+$FirstName+'"
,"customfield_12722":"'+$LastName+'"
,"customfield_12723":{"value":"'+$EmployeeCategory+'"}
,"customfield_12732":"'+$Externalfunction+'"
,"customfield_12725":"'+$CorporateID+'"
,"customfield_12726":{"value":"'+$VermegCompany+'"}
,"customfield_12685":{"value":"'+$IndusRegion+'"}
,"customfield_12673":{"value":"'+$Product+'"}
,"customfield_12727":{"value":"'+$Profile+'"}
,"customfield_12667":{"name":"'+$Manager+'"}
,"customfield_12708":"'+$BeginDate+'"
,"customfield_14000":"'+$Reglementation+'"
,"customfield_14001":"'+$Department+'"
,"customfield_14002":"'+$SubDepartment+'"}
}";
в строковую переменную, например:
String json = "{fields:{project:{\"key\":\""+ projectkey +"}"
+ "\",\"issuetype\":\""
+ "\",\"customfield_12721\":\"" + employee.getFirstName()
+ "\",\"description\":\"" + description
+ "\",\"summary\":\"" + summary
+ "\",\"customfield_12722\":\""+ employee.getLastName()
+ "\",\"customfield_12732\":\"" + employee.getFte()
+ "\",\"customfield_14000\":\"" + employee.getReglementation()
+ "\",\"customfield_14001\":\"" + employee.getDepartment()
+ "\",\"customfield_14002\":\"" + employee.getSubdepartment()
+ "\",\"fulltime\":" + Math.round(Double.parseDouble(employee.getFulltime().replaceAll(",",".")))
//+ ",\"email\":\"" + employee.getEmail()
+ ",\"citizenship\":\"" + employee.getCitizenship()
+ "\",\"gnn\":\""+ employee.getGnn()
+ "\",\"company\":\"" + employee.getCompany()
+ "\",\"employeeid\":\"" + employee.getEmployeeid()
+ "\",\"customfield_12708\":\"" + employee.getStartdate()
//+ "\",\"enddate\":\"" //+ employee.getEnddate()
+ "\",\"product\":\"" + employee.getProduct()
+ "\",\"customfield_12725\":\"" + employee.getInternalnumber()
// + "\",\"employeeid\":\"" + employee.getEmployeeid()
+ "\"}}";
Не могли бы вы помочь?