Hello Everyone,
I am trying to develop a scriptrunner script that will delete issue-links on the issue that calls the IssueLinkCreatedEvent. This deletion has to check some requirement in the main issue but i am not able to always get the correct main issue.
This is because of 2 reasons:
1. The IssueLinkCreatedEvent does not have any information about the issue that has fired the IssueLinkCreatedEvent, so the following line will give back a null because the event does not contain a issue object:
Issue issue = event.issue
2. The event also doesn't contain the direction of an issue-link creation:
I know i can get the source and destination object by the following code
IssueLink issueLink = event.issueLink
Issue issueDestination = issueLink.destinationObject()
Issue issueSource = issueLink.getSourceObject()
But the problem is when you select outward or inward type of the link the destination and source will swap issue id's. Because of this i cannot get the main parent issue out because the IssueLinkCreatedEvent also doesn't provide information on which direction the link is going!
For example if i have a issuelink with:
Name: Test
Outward: Tests
Inward: Is tested by
The IssueLinkCreatedEvent does not contain the direction of a outward or inward issue-link.
Two possible solutions that will solve my issue:
1. Does someone have any idea how to get the issue that fires the IssueLinkCreatedEvent!
or
2. Is there a way to get or provide the IssueLinkCreatedEvent with the correct direction it is going ? for example how to know if it is "is tested by" or "Tests"