We would like to use team calendar in confluence - nowhere else.
Otherwise we would have to make sure, that no critical data are transferred to internet. That´s nearly impossible.
Is ist possible to deactivate the Subscribe-Button?
Hello @naveen arroju ,
I think you could use the "Send a custom email" feature from ScriptRunner, using this condition (change the field id with yours) :
import com.atlassian.jira.component.ComponentAccessor
def nameOfLaptopField = "Laptop"
def idOfLaptopField = 11001
def laptopField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(idOfLaptopField)
def laptopFieldValue = issue.getCustomFieldValue(laptopField)
def laptopFieldChanged = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {it.field == nameOfLaptopField}
if (laptopFieldChanged && laptopFieldValue == "Dell"){
//Send mail to DELL team
return true
}
return false
Make sure you select each event that may be used to change the field value, i.e. Issue updated for a direct edit, or a transition event - in that case position the event after the issue reindex.
Thank you for the update @Antoine Berry
I have modified the code and updated on jira but not work. Can you please check below code
import com.atlassian.jira.component.ComponentAccessor
def nameOfAssigntoqueueField = "Assign To Queue"
def idOfAssigntoqueueField = 10135
def assigntoqueueField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(idOfAssigntoqueueField)
def assigntoqueueFieldValue = issue.getCustomFieldValue(assigntoqueueField)
def assigntoqueueFieldChanged = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {it.field == nameOfAssigntoqueueField}
if (assigntoqueueFieldChanged && assigntoqueueFieldValue == "OPS_SLS"){
//Send mail to OPS_SLS team
return true
}
return false
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Antoine Berry,
I have tried the several times above script but not working can you please help on this.
Thank You,
Naveen Arroju.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @naveen arroju ,
please keep in mind that this script is a condition script, meaning that it needs to return "true" for the mail to be sent. You still need to fill the email, subject templates etc.
Also I would need the error message from the logs to be able to help you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Antoine Berry ,
Thank you for the response.
I have tried again unable to get emails.
please find the below details I have mentioned on sending custom email in script runner
1 applied to --> selected projected OPSDEV
2. event ---> issue updated
condition to configuration:-
import com.atlassian.jira.component.ComponentAccessor
def nameOfAssigntoqueueField = "Assign To Queue"
def idOfAssigntoqueueField = 10094
def assigntoqueueField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(idOfAssigntoqueueField)
def assigntoqueueFieldValue = issue.getCustomFieldValue(assigntoqueueField)
def assigntoqueueFieldChanged = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {it.field == nameOfAssigntoqueueField}
if (assigntoqueueFieldChanged && assigntoqueueFieldValue == "OPS_SLS"){
//Send mail to OPS_SLS team
return true
}
return false
3. email template
Team,
This is a test email for auto-notifications for the SLS queue.
${issue. summary} has been assigned now to the SLS team and requires your attention.
4. subject templet
Issue ${issue.key} has been assigned to SLS
5. to address
naveen.sri25@gmail.com
6. saved
please find the attached screenshot and payload
{ "projects": "[OPSDEV] (java.util.ArrayList)", "@class": "com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmailCommand (java.lang.String)", "issue": "OPSDEV-1833 (com.atlassian.jira.issue.IssueImpl)", "friendlyEventNames": "Issue Updated (java.lang.String)", "version": "12 (java.lang.Integer)", "relatedProjects": "[[key:OPSDEV, name:(Development Only) NOC Service Desk : xxxxx]] (java.util.ArrayList)", "name": "Send a custom email (java.lang.String)", "canned-script": "com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail (java.lang.String)", "id": "75fb2198-d1ea-4bd0-9885-9a042c839fb3 (java.lang.String)", "event": "com.atlassian.jira.event.issue.IssueEvent@1483ea41[issue=OPSDEV-1833,comment=<null>,worklog=<null>,changelog=[GenericEntity:ChangeGroup][issue,26857][author,ug:7716c452-f8a0-45af-abbf-9ae909429e78][created,2021-11-29 16:44:38.103][id,103841],eventTypeId=2,sendMail=true,params={eventsource=action, baseurl=https://xxxxxxxx-dev.com},subtasksUpdated=true,spanningOperation=Optional.empty]", "bundle": "com.atlassian.jira.event.issue.DefaultIssueEventBundle@3c503a7e", "events": "[2] (java.util.ArrayList)" }
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.
Hi @Antoine Berry ,
Can you please check the above steps and please correct me if I am wrong.
Please reply to me on this issue.
Thank you,
Naveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you,
Ivan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you’re open to solving this with an app other than scriptrunner, we natively support this kind of config in Notification Assistant for Jira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey everyone,
Is there any way to find whether the a field is updated or not? And can we get its updation date also?
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.