Hello! My first time here and I am new to programming.
I have a code that need to get the user who made a change to a custom field, but I'm having trouble.
The code I'm trying to hit follows, I identified my difficulty with the bold. The objective of this groovy is sending a message to a specific group on Telegram application, but only want the user who made the change in the custom field.
Thanks for any help.
UserPropertyManager userPropertyManager = ComponentAccessor.getUserPropertyManager()
CustomFieldManager customFildManager = ComponentAccessor.getCustomFieldManager()
CustomField horasOrcadas = customFildManager.getCustomFieldObjectByName("Horas Orçadas")
String oh = issue.getCustomFieldValue(horasOrcadas);
String assignerName = (issue.getAssigneeUser()!=null ? issue.getAssigneeUser().getDisplayName() : "Sem responsável")
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost("Info about the group, this part still ok");
List<NameValuePair> urlParameters = new ArrayList<NameValuePair>();
urlParameters.add(new BasicNameValuePair("chat_id", "the id of the group, ok"));
urlParameters.add(new BasicNameValuePair("text", "Alerta S.O.N.E.\nAlterado: " + issue.getKey() + ".\nUPDATEBY: " + issue.getCreator.getDisplayName() + ".\nResponsável: " + assignerName + ".\nHoras Orçadas: " + oh));
httpPost.setEntity(new UrlEncodedFormEntity(urlParameters, "UTF-8"));
that need to get the user who made a change to a custom field, but I'm having trouble.
You'll want to use the ChangeHistoryManager. You can pass a JIRA Issue to the ChangeHistoryManager to get the history for the issue. You'll loop it and find the right customfield and trigger the HttpPost
In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to have–in order to produce a reliable long-term roadmap. We're tur...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG