Hi
I would like that description field content is adjusted based on the checkbox, radio button selection using behaviours in scriptrunner.
All this should happen before Issue is created (using Raise a request).
I've searched and tested many codes but the field remains empty, whatever I tried to code.
Thanks for your help
Hey @Philippe Beltran ,
Without knowing the code you've already tried I think you should be able to continue based on your previous behaviors.
In the API quick reference there is specific example for the description field.
https://docs.adaptavist.com/sr4js/latest/features/behaviours/api-quick-reference
First you need to ge the field of course:
def cfDescription = getFieldByName("Description")
but then you can set it like any other normal text field.
cfDescription.setFormValue("the text you want to set")
I just tested that, unfortunately Description field remains empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any chance you could post the exact code you are using?
I'd be happy to try and reproduce it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the simplified code I use to perform test:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FormField
import com.atlassian.jira.issue.customfields.option.Option
def list1Field = getFieldById(getFieldChanged())
def list1FieldValue = list1Field.getValue()
def cfDescription = getFieldByName("Description")
if (list1FieldValue == "App 4")
{
cfDescription.setFormValue("the text you want to set")
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did some testing myself and seems it isn't willing to work with the getFieldByName
In my test this works:
def cfDescription = getFieldById("description")
cfDescription.setFormValue("TEST THIS IS THE TEST!")
be sure to keep the "id" case-sensitve :)
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.
That's weird. I have this code in front of me and just tested it and it works.
Do make sure the description is in lowercase.
Is the If clause triggering? If you move it outside of the If does it work then?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
No still nothing. I replaced description with summary (as it is also a system field). there it works perfect.
It's only the description field which is causing trouble.
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.
Really strange.
Since the code seems to work fine on my test instance I'm puzzled as to why it wouldn't on your system. Not like it's the most complicated code ever..
If nothing shows up you might have to see if anybody else has a clue, or open a ticket with Adaptavist (https://productsupport.adaptavist.com/servicedesk/customer/user/login?destination=portals)
Perhaps something specific to your app version is making it bug out?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Only setting I could think of would be some permissions on the fields but if you can change it manually the behaviour should be able to as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When I check the field using webtool on chrome I see that textbox is a textbox keyboard focusable but description field have other settings. Not sure if that can be the problem (see screenshots)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
well it will be different as it is a system field and also a multiline instead of a single line.
Do you see anything in the Console tab?
You can open up the console first, then check the box and see if anything pops up as warning/error..
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.
Well my bag of tricks is empty :)
I'd suggest opening a ticket now and see if something changed with your version or if a bug snuck in..
On my test system the code works fine so I don't see anymore what we can change
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much for your support (even we were unable to fix the problem).
I will raise a ticket with Adaptavist
Philippe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm sorry I'm not able to get you to a working solution.
If they come back with a reason why it's not working I'd love to know what the culrpit was!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For sure I will inform you if we find what is causing the problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Dirk Ronsmans for helping, those are definitely the correct trouble-shooting steps.
The other thing to check is that you have definitely created a mapping between your behaviour and is the project/issue type(s) , or service desk/request type(s) it should apply to.
I think you may be creating a ticket with us - great.
Something else to check is I believe there are plugins that can replace the standard wiki text area that Jira provides with a custom one. In addition, there are entire themes that replace the service desk portal which we can't support due to the nature of this functionality.
So let us know if you are doing this in the portal view, or if either of those other things apply.
cheers, jamie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jamie Echlin _ScriptRunner - The Adaptavist Group_
The mapping is done and working as when I made test with Summary field instead Description field it works.
I checked in the plugins and did not see any pointing to wiki text.
Philippe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can see that this is in the JSM portal view.
I believe this is not working with the new AtlasKit editor that came in the most recent version of JSM. Did you raise a support ticket? If you did can you reference this thread, and we will get this fixed. I'll create a public bug ticket.
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 Philippe,
This appears to be caused by the bug we have listed here: https://productsupport.adaptavist.com/browse/SRJIRA-5076
We have linked it to this ticket and added you as a watcher so you'll be automatically notified as soon as it's fixed and released. This will most likely be in the next release that goes out.
If you have follow-up questions or issues to report please let us know through the ScriptRunner for Jira support portal.
Kind regards,
Katy
Adaptavist Product Support
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.
We have the following:
Jira v8.16.0
Scriptrunner Version: 6.23.0
Kind regards
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.