You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What Operating System are you using (both controller, and any agents involved in the problem)?
K8 on AWS
Reproduction steps
This is my slack notify step which is part of my jenkins pipeline and extracted only the error step. Below I have the "slackTemplate2.text" file which contains my "blocks" and I read that in my pipeline replacing the values for only one placeholder "VERTICALNAME".
When we read from the file in step 6 below it errors out and the error is mentioned below. The same blocks will work if we define in a variable as below
sed "s|VERTICALNAME|$verticalName|" "${WORKSPACE}/Industries-automation/slackTemplate2.text" | tee "${WORKSPACE}/Automation/target/json-reports/results.text"
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
K8 on AWS
Reproduction steps
This is my slack notify step which is part of my jenkins pipeline and extracted only the error step. Below I have the "slackTemplate2.text" file which contains my "blocks" and I read that in my pipeline replacing the values for only one placeholder "VERTICALNAME".
When we read from the file in step 6 below it errors out and the error is mentioned below. The same blocks will work if we define in a variable as below
def blocks = [
[
"type": "header",
"text": [
"type": "plain_text",
"text": "Financial Test Execution Summary"
]
]
]
slackNotify step
stage('Slack Notify') {
slackTemplate2.text
[
[
"type": "header",
"text": [
"type": "plain_text",
"text": "VERTICALNAME Test Execution Summary"
]
]
]
Error
ERROR: Slack notification failed with exception: net.sf.json.JSONException: Invalid JSON String
22:00:57 ERROR: Slack notification failed with exception: {"ok":false,"error":"no_text"}
22:00:57 ERROR: Slack notification failed. See Jenkins logs for details.
Expected Results
The result should be the same, whether reading from the file or from the variable for the blocks variable that we pass to slackSend command.
If we use the readFile and then pass the value to the "blocks" in slackSend command it throws error.
Actual Results
ERROR: Slack notification failed with exception: net.sf.json.JSONException: Invalid JSON String
22:00:57 ERROR: Slack notification failed with exception: {"ok":false,"error":"no_text"}
22:00:57 ERROR: Slack notification failed. See Jenkins logs for details.
Anything else?
No response
The text was updated successfully, but these errors were encountered: