Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hello there,
We are trying to achieve the following scenario using SIL Script.
Scenario:
Adding a CHECKBOX selected values as a comment automatically after the transition.
Custom field type : Checkbox
Checkbox Values:
Consider user selects "For Study" & "For Reply" as checkbox values.
Expected Comment After Transition:
This issue is updated with the following needed actions
For Study
For Reply
Kindly help us to achieve the above scenario. Thank you so much.
Regards,
Sami Ahmed Shaik.
Hello @Sami Ahmed Shaik ,
You can create a listener for the Update Issue event with a code like this:
JFieldChange [] changes = lastIssueChanges(key);
for(number i = 0; i < size(changes); i++) {
if (changes[i].field == "customfield_XXXXXX") {
addComment(key, currentUser(), replace(key.customfield_XXXXXX, "|", "\n"));
break;
};
}
Please, replace XXXXXX with your custom field id in two places.
Thanks for the quick response, I tried with provided script but it's not working.
Is there a way we could use the script in the POST Function instead of listeners ?
Using of listeners or live fields is impacting the performance of our instance, so we would like to avoid listeners & live fields.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. remove the Checkbox field from the Edit screen (changes in the Edit screen can be caught only be a listener)
2. Create a screen with the Checkbox field in it.
3. Create a transition with this screen.
4. Add a post function to this transition as the last but one (before triggering event) with the code I pasted above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As you suggested, I did try with the following code but it's not working
JFieldChange [] changes = lastIssueChanges(key);
for(number i = 0; i < size(changes); i++) {
if (changes[i].field == "customfield_13914") {
addComment(key, currentUser(), replace(key.customfield_13914, "|", "\n"));
break;
};
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How can I fix the code ? Could you please help me in achieving this scenario?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You code looks correct to me. You need to debug it. Add a logPrint("ERROR", "your message") ; to your code and have a look what messages you have. You should make sure that your code has been executed. Also look for errors in the atlassian-jira.log file
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the response. We are getting the following error while executing the script.
2020-09-07 12:10:23,480+0300 pool-11730-thread-1 ERROR e10325 935x147641x1 16pqoy2 10.56.7.22 /rest/keplerrominfo/commons/latest/gadget/programs/jjupin-sil-runner/8/run [c.k.s.lang.routines.LogPrintRoutine] Error Message for SIL Script
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you paste the error? I believe the message is not complete.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We found the following single line error in the Atlassian logs
Atlassian Logs
2020-09-07 12:19:22,173+0300 http-nio-8081-exec-7 ERROR e10325 739x205098x1 cnruhp 10.56.7.22 /secure/CommentAssignIssue.jspa [c.k.s.lang.routines.LogPrintRoutine] Error Message for SIL Script
SIL Script Console: When trying to DEBUG the script
2020-09-07 12:22:16,504+0300 pool-11730-thread-3 ERROR e10325 950x168686x1 14u1oic 10.56.7.22 /rest/keplerrominfo/refapp/latest/async-script/checkScript [c.k.s.lang.routines.LogPrintRoutine] Error Message for SIL Script
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
is this something related to COMMENT PERMISSION ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
how can we resolve this scenario ? any suggestions please ?
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.
Please create a support ticket with Cprime:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have already raised the cPrime support ticket since last 4 days ago, since then no proper solution from support team.
cPrime Support Ticket # CADS-7083
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register Now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.