Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,598
Community Members
 
Community Events
184
Community Groups

Working with IssueLinkManager without history entries

Hello community, 

I am in front of optimizing an routine job done in script runner. 

Basically, every night, it compares some custom fields with set off issues and recreates issue links between true findings. 

Thats working fine and as expected, the problem is, when users tries to reach the issue history.

Its flooded with system automation user entries of removing / recreating links.

My idea is, to 

  1. Do not write history at all, but whole script is based on issueLinkManager.createIssueLink and issueLinkManager.removeIssueLink methods where I cannot find any way how to not write a history event.
  2. After running the routine, at the end, run clean-up of history - simply remove all history event caused by system automation user, which perfectly fine by business need.

Any ideas how to achieve at least one of those?

Thanks, Tom

1 answer

0 votes
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Aug 31, 2022

I am not aware of a way to create issue links using lower level API that don't also create the history. You'd need to get into some pretty complexe "OfBizDelegator" methods. You can always go explore the source code for the DefaultIssueLinkManager class (you should have access to the jira source code from your license page) to see how Jira does the createIssueLinke and removeIssueLink. 

And I am not aware of a method to selectively remove history items (you can only delete the entire history for an issue, that is designed to clean up the history when you delete an issue).

My suggestion would be for your script to be smarter and only perform the absolutely necessary operations. Before adding a link, validate that conditions that would cause it to be removed later are not true. Before removing it, do the reverse validation.

Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Aug 31, 2022

I actually just accidentally came across: https://docs.atlassian.com/software/jira/docs/api/8.13.15/com/atlassian/jira/issue/link/DefaultIssueLinkManager.html#removeIssueLinksNoChangeItems-com.atlassian.jira.issue.Issue-

But it won't help you with the creation part.

And it removed ALL the issue links. As stated in the javadoc, this is intended to be paired with a delete issue operation.

Yup, I find that one as well. The trouble is, that the issue is very complex part of SAFe automation, so the root issues do have up to 50 links from 6-7 different link type. 

The troubling automation do working with only 1 particular link type. 

Well, customer is 15k+ DC priority tier, so I will try ask Atlassians as well. 

Figured out, that even Tempo guys do have this issue, but with history spammed with logtime records in long terms tasks. Will keep this issue updated. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events