Hi All,
I'm trying to add a comment to issue when an issue transition happens at a specific time (between 8:30 to 10:00) in a day. Below my script,
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.comments.CommentManager
import com.opensymphony.workflow.WorkflowContext
import org.apache.log4j.Category
def date = new Date()
def formattedDate = date.format('hh:mm')
log.info (formattedDate)
SNGStart = "8:30"
log.info (SNGStart)
SNGEnd = "10:00"
log.info (SNGEnd)
if (formattedDate > "SNGStart" && formattedDate < "SNGEnd" ) {
String currentUser = "jira-admin"
commmgr = (CommentManager) ComponentManager.getComponentInstanceOfType(CommentManager.class)
commmgr.create(issue, currentUser, "Comment automatically generated!! (test)", true)
issue.store()
}
There is no error on logs but not getting excepted result. Could you please help me to correct this one?
Many thanks in advance.
Thanks,
Sanu P Soman