Hi Team,
I am trying to add warning message using post function. But this warning message should be visible if there is no subtask ticket for parent issue. If there is any subtask tickets it should not give warning message. Can you help me to write condition for that
Hi @priym ,
Something along the line of :
import com.atlassian.jira.component.ComponentAccessor
def subtaskManager = ComponentAccessor.getSubTaskManager()def subtasks = subtaskManager.getSubTaskObjects(parentIssue)
if (subtasks.isEmpty()) {// Add your warning message code here// For example:issue.setCustomFieldValue(warningField, "No subtask tickets found for this issue.")}
This is code for Server, the question was about Cloud
Welcome to the Atlassian Community!
Post-functions can not give you warning messages, they are not connected to the UI at all. The best you could do would be to create a comment on the issue that highlights that the user has done something wrong.
You might be able to do something with conditions, listeners, automation or validators though.
Could you tell us what the actual requirement is? In the sense of where it should happen? Is the warning for issue view? Or you want to tell people about it during a transition? Or something else?
It looks like you're new here. Sign in or register to get started.