Forums

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

To enable deletion of issues not included in a sprint using jira behavior

이지성
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 2, 2023

To enable deletion of issues not included in a sprint using jira behavior

I used the script below because I wanted to activate the delete button on the screen for issues that are not included in the sprint like the question title, but where can I see the logs for that script? The script doesn't seem to work, so tell me if there's something wrong with the script

 

import com.atlassian.jira.component.ComponentAccessor  

def issue = getFieldById("issuekey").getValue() // 이슈 키 가져오기

def sprintManager = ComponentAccessor.getComponent(com.atlassian.greenhopper.service.sprint.SprintManager)

def boardManager = ComponentAccessor.getComponent(com.atlassian.greenhopper.manager.board.BoardManager)

def issueService = ComponentAccessor.getIssueService()

def sprintCustomField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Sprint")


if (issue) {

def issueObject = issueService.getIssue(issue).getIssueObject()

def sprints = issueObject.getCustomFieldValue(sprintCustomField)


if (sprints) {

// 이슈가 스프린트에 등록되어 있습니다. 아무 작업도 수행하지 않습니다.

} else {

// 이슈가 스프린트에 등록되어 있지 않으므로 삭제 권한을 부여합니다.

// issue.setDeletable(true) // 이렇게 권한을 설정할 수 있을 것으로 예상됩니다.

}

}

 

1 answer

0 votes
Craig Nodwell
Community Champion
November 18, 2023

Hi @이지성 welcome to the community.  I don't think this is an instance where you would use a behaviour.  Behaviours are primarily used to drive screen and the behaviors of that screen.  I think you'd be better off here with a fragment and then a script behind that fragment.

Suggest an answer

Log in or Sign up to answer