Hello all, I am developing a event listener plugin using the example in the docs.
I have a User story which is in a Epic and in my listener whenever the User story is updated i want to perform some action on the story for which i also need the ID of the Epic.
From the UI i can see the Story is linked to Epic (under "Epic Link"), but in the the issue object, i get in the listener i cant seem to be able to see the property, i have seem examples where people have tried to use customfields to get the Epic info. When i debug, i see that the issue has no customfields.
Is there any other way to get the Epic ID from User Story.
Thanks in Advance
I was able to solve my problem by doing the following
// this does not work, returns null
// CustomField field = customFieldManager.getCustomFieldObject("Epic Link");
// i have seen examples of this, but doesnt work
// CustomField field2 = customFieldManager.getCustomFieldObject("customfield_10101");
// What worked was
List<CustomField> fields = customFieldManager.getCustomFieldObjects(issue);
CustomField epicLinkField = null;
for (CustomField field : fields) {
if ("Epic Link".equals(field.getFieldName())) epicLinkField = field;
}
Issue epicLink = null;
if (epicLinkField != null) {
// we get the Epic issue object
epicLink = (Issue) issue.getCustomFieldValue(epicLinkField);
}
@integmas - Epic link change doesn't have a webhook you can use.
So changing the epic link in the UI doesn't trigger anything.
You can create a schedule automation to run every X mins/hours/days (depending on what you're trying to get) and copy the epic link to a new custom field (text type). Then, when the value of that custom field changes you'll get a webhook notification to your listener.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply.
I want to get the Epic name from issue, i have created a EventListener in my plugin using the annotation "@EventListener".
I am able to catch the issue in my listener but i cant see a way to get "Epic" from issue, without running any queries.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline 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.