I am trying to update the releases on a jira project using Scriptrunner Schedule jobs option :-
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.project.version.Version
import com.atlassian.jira.project.version.VersionManager
// Specify the project key and release ID
def projectKey = "TJ" // Replace with the key of your Jira project
def releaseId = 1234 // Replace with the actual release ID
// Specify the new start and release dates
def newStartDate = new Date() // Replace with the desired start date
def newReleaseDate = new Date() + 7 // Replace with the desired release date
// Get the version manager
def versionManager = ComponentAccessor.getVersionManager()
// Find the release by project key and release ID
def release = versionManager.getVersion(projectKey, releaseId)
[Error message: [Static type checking] - Cannot find matching method com.atlassian.jira.project.version.VersionManager#getVersion(java.lang.String, int). Please check if the declared type is correct and if the method exists.]
// Update the start and release dates
release.setStartDate(newStartDate)
[Error message : [Static type checking] - Cannot find matching method java.lang.Object#setReleaseDate(java.util.Date). Please check if the declared type is correct and if the method exists.]
release.setReleaseDate(newReleaseDate)
[Error message: [Static type checking] - Cannot find matching method java.lang.Object#setStartDate(java.util.Date). Please check if the declared type is correct and if the method exists.]
// Save the changes
versionManager.updateVersion(release, false)
[Error message : [Static type checking] - Cannot find matching method com.atlassian.jira.project.version.VersionManager#updateVersion(java.lang.Object, boolean). Please check if the declared type is correct and if the method exists.]
I am getting errors at the bold lines.
Can you please help to fix this issue.