Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Links without changing the updated date (when deleting links from the system)

Lara Lopez
Contributor
September 12, 2024

We have too many types of links in Jira and want to delete some of them.

I have tried them deleting them in jira, which has the options of fully deleting them or replacing them with other links. In both options the updated date of the tickets gets updated.

The thing is some of this links have been used a lot, I am talking about more than 1000 issues. If I delete this link, hundred of issues get their updated date modified, some of them really old.

Has anyone had a similar problem? Is there any way to replace the links without affecting the updated date?

Thanks

3 answers

0 votes
Cornelius Gillner
Contributor
December 30, 2024

I just came across this as we also have quite a lot of duplicate content such as link types (and custom fields, priorities, statuses and other stuff) after moving multiple server instances to a single data centre instance.
I was also unable to stop the updated-date from changing, but having experienced this I can perhaps recommend one thing:

I have a script to reset the updated date to the last update not made by a particular user.
The use case for this was that we had changed updated-dates to change some custom field values and we needed to reset them to not mess up some teams filters. So for a JQL search, we reset the updated date to the last date that was not caused by the admin user (with which we replaced the custom field values).
Let me know if you want to see the code. The hardest part of this would be identifying the tickets for which you want to reverse/reset the dates.

Lara Lopez
Contributor
January 2, 2025

Thanks Cornelius for the idea.

We have given up modifying the links as we thought it would be too much noise for the teams.

We are not doing this right now but I am curious about your script. Did you just update the last issue update or did you delete from the history the changed link ? Did that update the issue updated date?

Cornelius Gillner
Contributor
January 2, 2025

Hi Lara,

it basically just updates the issue update date. Nothing gets deleted.
It requires Sriptrunner's HAPI.
Here's a redacted version of it:

import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.changehistory.ChangeHistoryManager
import com.atlassian.jira.component.ComponentAccessor
ApplicationUser currentUser = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
ChangeHistoryManager changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
IssueManager issueManager = ComponentAccessor.getIssueManager()
Issues.search("project = JQL AND updated > -1d").each { issue ->
def changes = changeHistoryManager.getAllChangeItems(issue)
for (change in changes.reverse()) {
if (change.userKey != "JIRAUSER0815") {
MutableIssue thisIssue = Issues.getByKey(change.issueKey) as MutableIssue
log.debug(change.issueKey + ": " + change.created)
thisIssue.setUpdated(change.created.toTimestamp())
thisIssue.store()
break
}
}
}

 

Like Lara Lopez likes this
0 votes
Manoj Gangwar
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 12, 2024

Hi @Lara Lopez 

I think It is not feasible. The actual updated field doesn't care how the update came to the issue but just reflects that there was an update.

Lara Lopez
Contributor
September 12, 2024

Hello Manoj,

But for example when you delete a resolution from the system neither the udpated date nor the resolution date get modified. Different behaviours for the same action.

The question is if someone has eve had this problem, if they found and alternative method (that does not involve touching the database).

0 votes
Hans Polder _Devoteam_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 12, 2024

@Lara Lopez ,

I believe this is working as designed. I just tested it in my cloud test instance, and there the same behavior occurs.

Since you are in fact making a significant change to a ticket (linked issues are pretty important), I can imagine that it is intended to update the 'Last Updated' date accordingly.

Since you are in datacenter, maybe you could attempt something via the database, but I would stay away from that (and I don't know if this in fact would or would not trigger the 'Last Updated' date itself.

Lara Lopez
Contributor
September 12, 2024

The database will not trigger the updated date, but I rather stay away from it. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events