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

Scriptrunner Behaviours - Using screen ID in Initialiser Edited

I'd like to implement a pre-filled Description field for any project using a certain workflow, so I set up a Behaviour based on the Screen ID of the Create Issue screen for that workflow. However, it's not working. If I remove the screen ID check, it works as expected on all screens, but that's not what I want  :)

 

def desc = getFieldById("description")

 

def descDefaultValue = """blah""".replaceAll(/ /, '')

 

if (FieldScreen.getId() == 12903) {

     if (! underlyingIssue?.description) {

          desc.setFormValue(descDefaultValue)

     }

}

 

Apologies in advance if I missed something simple. Thanks for the feedback.

 

3 answers

1 accepted

0 votes
Answer accepted

Following up.. I didn't realize the screen ID was changing. Once I set up the code to detect and print screen ID during troubleshooting, I was able to get it working.

Hello @Veronica Kolstad

Your workflow associates with certaion issue types, so why not just add mapping to this issue types and remove this screen check?

Thanks for your quick feedback, Mark. We have about 30 groups using JIRA in our organization at this time, and about 80% of the groups use the same workflow for their Scrum teams. I am trying to simplify things for that 80%, since they're all writing user stories.

However, we use the same basic issue types (Story, Bug, Epic, Sub-task) across the organization to keep things simple. If we auto-fill by issue type, my understanding is this would not exclude the 20% of the organization that would not value the pre-filled description we are trying to implement in the Story type.

Using the screen name was suggested by @JamieA here, so I think it's possible and I'm just doing something wrong. I switched to using the screen ID when the screen name didn't work, so I'm hoping there's just something wrong with my syntax.

Hi @Veronica Kolstad ,

I am trying to add an auto comment when we close a ticket :

when we click on resolve button we have a screen called CHD Resolve Screen with resolutions and comment box, I am trying to add an auto comment on the comment box. I have tried the following script :

def desc = getFieldById("description")

def defaultValue = """Your issue is now resolved""".replaceAll(/ /, '')

if (getFieldScreen().name== "CHD resolve screen") {
if (! underlyingIssue?.description) {

desc.setFormValue(defaultValue)

}

}

 

but looks like I still do not get the message on the comment box, do you think I am doing something really wrong as I do not get any error message 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase

The benefits of using Jira in different departments

Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...

62 views 0 3
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