Hello,
could you please help me tranfer all of my comments to internal? I tried following script I found on net but it is not working...
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.entity.property.JsonEntityPropertyManager
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.web.bean.PagerFilter
final jqlSearch = "jql"
def searchService = ComponentAccessor.getComponent(SearchService.class)
def issueManager = ComponentAccessor.getIssueManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def commentManager = ComponentAccessor.getCommentManager();
def jsonManager = ComponentAccessor.getComponent(JsonEntityPropertyManager)
//JQL Search
def issues = null
SearchService.ParseResult parseResult = searchService.parseQuery(user, jqlSearch)
if (parseResult.isValid()) {
def searchResult = searchService.search(user, parseResult.getQuery(), PagerFilter.getUnlimitedFilter())
issues = searchResult.issues.collect {issueManager.getIssueObject(it.id)}
}
//Setting comments to Internal
if (issues) {
for (Issue foundIssue : issues) {
def comments = commentManager.getComments(foundIssue)
for (def comment : comments) {
jsonManager.put(user, "sd.comment.property", comment.getId(), "sd.public.comment", "{ \"internal\" : true}" , (java.util.function.BiFunction) null, false)
}
}
}
Thank you,
Lukas
Hello all,
my bad this script works but gives you null result. Just replace jql with your querry without quotes and you are good to go :)
Code is by https://community.atlassian.com/t5/user/viewprofilepage/user-id/609712
Hi, I tried to use this script and the comments' label was changed to internal. However when I tried to filter the issues using this "issueFunction in commented('visibility internal')" the filter didn't return any issue that was changed from the script. Do you know the reason why or what should be changed in order to filter the issues?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.