Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Interact with Description field content

Hi

I would like that description field content is adjusted based on the checkbox, radio button selection using behavioursdescription field.pngcheckboxes.png 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

2 answers

1 accepted

0 votes
Answer accepted
Dirk Ronsmans Community Leader May 05, 2021

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")

Hi @Dirk Ronsmans 

I just tested that, unfortunately Description field remains empty.

Dirk Ronsmans Community Leader May 05, 2021

Any chance you could post the exact code you are using? 

I'd be happy to try and reproduce it.

Hi @Dirk Ronsmans 

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")
}

Dirk Ronsmans Community Leader May 05, 2021

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 :)

Hi

I already tested and it doesn't work

Dirk Ronsmans Community Leader May 05, 2021

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?

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.

Can it be due to any setting on our Jira?

Dirk Ronsmans Community Leader May 05, 2021

Really strange.

  • Do you see anything in your developer console of your browser? 
  • Or in the jira logs themselves? 

 

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?

Dirk Ronsmans Community Leader May 05, 2021

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.

Hi @Dirk Ronsmans 

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)description 1.pngdescription 2.pngdescription 3.pngsummary.png

Dirk Ronsmans Community Leader May 05, 2021

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..

Nothing is pops up when I check the box

Dirk Ronsmans Community Leader May 05, 2021

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

Hi @Dirk Ronsmans 

Thank you very much for your support (even we were unable to fix the problem).

I will raise a ticket with Adaptavist

Philippe

Dirk Ronsmans Community Leader May 05, 2021

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!

For sure I will inform you if we find what is causing the problem.

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

Hi @Jamie Echlin _Adaptavist_ 

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

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. 

Ticket created: PRODSUP-2468

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 

0 votes
Ravi Sagar Community Leader May 05, 2021

Hi @Philippe Beltran 

What is your Jira and ScriptRunner version?

Ravi

Hi @Ravi Sagar 

We have the following:

Jira v8.16.0
Scriptrunner Version: 6.23.0

 

Kind regards

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

167 views 6 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you