Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom message on each task #5

Closed
egavard opened this issue Mar 4, 2016 · 9 comments
Closed

Custom message on each task #5

egavard opened this issue Mar 4, 2016 · 9 comments
Labels

Comments

@egavard
Copy link

egavard commented Mar 4, 2016

Hi,

I'd like to know if it is possible, for each notification kind, to set a custom message.
I'd like, for example, on a broken build notify concerned users with @ markup.

Thanks

@jovandeginste
Copy link
Collaborator

Would that mean those users are always the same for a given job? (ie. fixed per-job configuration in jenkins?)

@egavard
Copy link
Author

egavard commented Mar 14, 2016

I mean that, for example, on a broken build, I'd like to advise the product owner and the scrum master that there's a problem.
Otherwise, on a simply unstable build, I'd like to only advise developers.

I would customize each message with the corrects @ to target concerned users in the jenkins conf.

@jovandeginste
Copy link
Collaborator

This issue has been open for a while now, and I've been thinking about it ever since. The reason I've not made any implementation for this is the following.

Since a few months I'm using Jenkinsfiles. This lets me combine any (supported) plugins programmatically. This means I can send any Mattermost notification at any stage of the job, exactly the way I want it (as a user).

If you never heard of Jenkinsfiles or the Jenkins workflow/pipelines plugins, I honestly suggest you check it out!

If there is anything holding you back from using it, I'm sorry this solution is not what you need. It may be opportune to reevaluate?

@zdtsw
Copy link

zdtsw commented Dec 19, 2016

We have similar requirement from our projects: when a build fails, mattermost sends direct message to the one who either starts the job or pushes the code changes, or at least use @ to mark them on the channel.
We do not have problem to send notification at any stage in the job by using Jenkins 2.0 pipeline. But we want to target users, more than just broadcast the "failed job status" to the whole channel.

@jovandeginste
Copy link
Collaborator

@zdtsw if you add @username in the message, the user is "targeted"; at this time it's not possible to send a direct message to a user via Mattermost.

@zdtsw
Copy link

zdtsw commented Dec 19, 2016

@jovandeginste , I'v it before posted here, but it did not work.....

e.g: in my Jenkinsfile,
mattermostSend channel: "#team1", color: 'bad', message: " @wezh01 job failed: ${JOB_URL}${BUILD_NUMBER} "

Go to mattermost #team1 channel, I can see:
@wezh01 job failed: http://myjenkins.com/job/whatmattermost/51
but @wezh01 is just a plain text, and I did not get any notification.

@jovandeginste
Copy link
Collaborator

I understand; probably because it is sent+formatted as "attachement" under the hood. That is a useful feature/setting to implement.

@charlietsai
Copy link

charlietsai commented Sep 13, 2017

I know this is old but I recently needed to use user-mentions as well. The above PR adds text as an optional argument for mattermostSend that adds that to the text field, which does allow for searchable and highlightable text.

@jovandeginste
Copy link
Collaborator

This should be solved with v2.4.1 if you use Jenkins Pipelines

jovandeginste pushed a commit that referenced this issue Jul 11, 2018
* Refactor variable names and comments
* Update error log
@covert8 covert8 closed this as completed Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants