ʞ
Если да, то каким образом?
А то можно менять поля через API без показа в истории тикета.
Size: a a a
ʞ
РС
A
ʞ
LC
URL url = new URL("http://URL/rest/api/content/123456")
def username = "l"
def password = "p"
String encodedTokenString = "Basic ${"$username:$password".bytes.encodeBase64()}"
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("PUT")
connection.setRequestProperty ("Authorization", encodedTokenString)
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Accept", "application/json");
OutputStreamWriter osw = new OutputStreamWriter(connection.getOutputStream());
osw.write("{\"id\":\"123456\"," +
"\"type\":\"page\"," +
"\"title\":\"new page_123\"," +
"\"space\":{\"key\":\"TEST\"}," +
"\"body\":{\"storage\":{\"value\":\"<p>This is the updated text for the new page</p>\"," +
"\"representation\":\"storage\"}}")
osw.flush();
osw.close();
connection.getResponseCode()
LC
URL url = new URL("http://URL/rest/api/content/123456")
def username = "l"
def password = "p"
String encodedTokenString = "Basic ${"$username:$password".bytes.encodeBase64()}"
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("PUT")
connection.setRequestProperty ("Authorization", encodedTokenString)
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Accept", "application/json");
OutputStreamWriter osw = new OutputStreamWriter(connection.getOutputStream());
osw.write("{\"id\":\"123456\"," +
"\"type\":\"page\"," +
"\"title\":\"new page_123\"," +
"\"space\":{\"key\":\"TEST\"}," +
"\"body\":{\"storage\":{\"value\":\"<p>This is the updated text for the new page</p>\"," +
"\"representation\":\"storage\"}}")
osw.flush();
osw.close();
connection.getResponseCode()
{"statusCode":500,"message":"","reason":"Internal Server Error"}
A
{"statusCode":500,"message":"","reason":"Internal Server Error"}
LC
org.codehaus.jackson.JsonParseException: Unexpected end-of-input: expected close marker for OBJECT (from [Source: com.atlassian.confluence.plugins.restapi.filters.LimitingRequestFilter$1@20427335; line: 1, column: 0])
A
URL url = new URL("http://URL/rest/api/content/123456")
def username = "l"
def password = "p"
String encodedTokenString = "Basic ${"$username:$password".bytes.encodeBase64()}"
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("PUT")
connection.setRequestProperty ("Authorization", encodedTokenString)
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Accept", "application/json");
OutputStreamWriter osw = new OutputStreamWriter(connection.getOutputStream());
osw.write("{\"id\":\"123456\"," +
"\"type\":\"page\"," +
"\"title\":\"new page_123\"," +
"\"space\":{\"key\":\"TEST\"}," +
"\"body\":{\"storage\":{\"value\":\"<p>This is the updated text for the new page</p>\"," +
"\"representation\":\"storage\"}}")
osw.flush();
osw.close();
connection.getResponseCode()
LC
V
М
М
VG
AM
G
A
AM
ʞ
ʞ