Hi community!
I need your help:
I have the follow code to insert epic information through API and I need to validate the field "description" is is filled or not
How do I make this?
This is the code:
def endpointUrl = "https://xpto/v1/integration/jira/epic/${issue.key}"
def http = new HTTPBuilder(endpointUrl)
def msg_update_epico = ""
http.request(PUT, ContentType.JSON) {
def requestContentType2 = ContentType.JSON
request.addHeader("Authorization: Bearer ${token}", "ContentType: application/json")
def commentManager = ComponentAccessor.getCommentManager()
if (issuescription.getText().isEmpty())
{
body = """
{
"status_id": "${status_cvv_id.toString()}",
"name": "${issuesummary}",
"delivery_date": "${devdate_value}",
"username": "${event_username}",
"useremail": "${event_useremail}",
"epic_description": "${issuedescription}",
"Progresso": "${progress.toString()}"
}"""
}
else
{
body = """
{
"status_id": "${status_cvv_id.toString()}",
"name": "${issuesummary}",
"delivery_date": "${devdate_value}",
"username": "${event_username}",
"useremail": "${event_useremail}",
"epic_description": "${issuedescription.replaceAll("()", "")}",
"Progresso": "${progress.toString()}"
}"""
}
log.info("POSTING update epic: ${endpointUrl}")
log.info("${body}")
msg_update_epico = JSON.message
//log.debug("Retorno update épico: ${msg_update_epico}")
log.debug("Retorno update épico: Automação executada com sucesso")
}