Hi Community,
for less than a year ago, in a group of several projects, we transferred almost all e-mails within the company to be sent from Automatin for Jira.
We haven't been able to do this so far: E-Mail when creating a Ticket on component Lead in project. Can anyone here help me and say if we need to look in a different direction.
Best regards
Jurica
Yes, you could easily create a Single User Picker custom field, set it using a Set Field Value post-function to the component lead of the first component of the issue (in case there are more than one), or create a Multi-User Picker custom field and set it to the component leads of all components on the issue, and then use this custom field as the recipient(s) of the email sent by Jira Automation.
Or you can use an Email Issue post-function from JMWE directly, without the need for this custom field.
The component lead of the first component of the issue is retrieved by this script:
issue.get("components")?.find{true}?.componentLead
And the list of component leads:
issue.get("components")*.componentLead?.unique()?.minus(null)
@David Fischer In this case, however, it is a slightly more difficult case. I do not want to send an email to the selected component but to a component that contains SSK * in its name and is not selected on the mentioned ticket but is in the list of project components.
Is this even possible? Consider I also have a script runner as a tool available.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jurica Petricevic sure, you can do this with JMWE. All that changes is the script:
ComponentAccessor.projectComponentManager.findAllForProject(issue.get("project").id).find{it.name ==~ /.*SSK.*/}?.componentLead
I used a regular expression to match the component name, you can play with it to refine the component name matching. The expression I used will return the first component whose name includes SSK (case-sensitive).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got exactly what I wanted. This is great. I earnd you self a beer once again again @David Fischer. Will this way of filling the field be a trigger for Automation? My wish when I have these values is to send an email to those users. Can I use this like a trigger or should i go on "create" trigger?
Thank you a lot once again kind sir :)
Best regards
Jurica
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you really want to send the email from Automation and not a JMWE post-function, then you add the Set Field Value post-function on the Create transition, and then you can use an Automation rule based on the Issue Created trigger to send your email - the Automation rule will run after the post-function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As far as I know A4J / smart values do not provide this functionality out of the box. There is a similar post in the community which describes how to workaround with sending a webhook:
As the component field could take more than one entries I suggest to keep in mind the question how to deal with the case there are several components added to an issue.
Hope this could give at least a hint to a solution.
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure this helps me. Something similar is true, but not what I'm looking for.
I was thinking of picking up the value of component lead via JMWE tool and post function, which I don't think is a problem for a tool like this, and then simply send an email to the person in that field. @David Fischer What do you say about this idea?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ouh....ok. couldn´t assume this from initial post/requirement =S
Appology but I´m not familiar with JMWE tool.
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Stefan Salzl can you help me more precisely? how exactly can I set such a rule in such a way that all the components that contain the SSK in their name theres component leads are added to one field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I´m not quite sure if we´ve got the same picture of your requirement. In order to clarify that we are heading in the same direction let´s take 1 step back and wrap up the use case.
As I understood your requirement:
Please let me know if this is correct and if not please correct me where I misunderstood something.
Thanks in advance.
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Stefan Salzl no, not a message for the selected component then for components that are within the project and have a name that starts with SSK *.
In some projects we have 1000 components, but I need to send an email only to those who are the leaders of the components that start with the SSK (in each of the 150 projects there are specific 3 SSKs that need to get an email)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.