Hi Team
I am developing Rest end points and fragments in Jira using custom plugin
following doubts I have listed below:
1.issueservice: found in jira server but, is it available in Jira cloud if yes how can we use in custom plugin
2.using jira properties (JSD) sd.public.comment - how can we set in our custom plugin
3. How to get comment body without tags in jira cloud in custom plugin (rest Api)
4.how to use the validate Transition in jira cloud which is using issueservice inteface to get transitions
5. how to get list of all categories in scheme using Rest Api’s
6.how can we perform operations on inward and outward issues
7. source and destination objects (how to get the info in Jira custom plugin)
please resolve my above doubts on priority
Welcome to the Atlassian Community!
Your use of the word "fragments" suggests you are looking at Scriptrunner for Server/DC, because there are no other frequently used apps that use that word (the SR team are looking at improving the language in fragments)
Jira Cloud and Jira Server/DC diverged almost a decade ago. It is better to think of them as two separate systems which do issue tracking and have compatible data (including a lot of config), rather than the same software.
You don't need issueservice in Cloud, you need to look at the REST calls to create issues remotely. The rest of your questions are much the same - have a look at the REST API for Cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using connect springboot to develop this plugin
In my custom plugin I need to copy the last attachment of one Issue to another issue
using java (springboot)
could you please share the code regarding this, would be helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to look at the REST API to do this (springboot is not relevant, Java can make REST calls).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In my custom plugin I am adding last comment to through java, but getting null data
public String addComment(String issueKey, String outwordIssueKey) throws JsonProcessingException {
//JsonNode issue = getIssue(issueKey);
JsonNode lastComment = getLastComment(issueKey);
System.out.println(lastComment);
String commentBody = lastComment.get("comments").get(0).get("author").get("body").asText();
System.out.println(commentBody);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
String issueUrl ="/rest/api/2/issue/"+outwordIssueKey+"/comment";
JsonNodeFactory jnf = JsonNodeFactory.instance;
ObjectNode payload = jnf.objectNode();
{
payload.put("body",lastComment.get("comments").get("body"));
ObjectNode visibility = payload.putObject("visibility");
{
visibility.put("identifier", "Administrators");
}
}
HttpEntity<Object> commentData = new HttpEntity<>(payload, headers);
ResponseEntity<String> createComment = restTemplate.postForEntity(issueUrl,commentData,String.class);
System.out.println("##########################$");
System.out.println(createComment);
return "sucessss";
}
this code I am attaching please suggest, why getting null data.
please do this on priority
Regards,
Shubhangi Nikam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What library are you using that provides "lastComment"? Is it one of the last comment apps?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
public JsonNode getLastComment(String issueKey) throws JsonProcessingException {
String commentData = "/rest/api/2/issue/" + issueKey + "/comment?orderBy=-created&maxResults=1";
String comment = restTemplate.getForObject(commentData, String.class);
JsonNode comInfo = objectMapper.readTree(comment);
System.out.println("coming in seviceImpl");
System.out.println("*****************************");
JsonNode cominfo = objectMapper.readTree(comment);
System.out.println(cominfo);
return comInfo;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this library or api providing me last comment, as i mentioned in my above code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That code seems to be reading all comments, via another library that provides "readTree" function. You'll need to check the documentation for that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.