issue.summary.toString(); or issue.getSummary().toString(); in JIRA 6.4.3

Trying to pull the string for the Summary coming in from emails.

 

Which is the correct syntax?

 

Thanks!

3 answers

0 vote

Hey Marty

Can you please provide more context about the "from emails" part?

If you are using the Java API issue.getSummary() returns a String.

If you are referring to the velocity vm file, issue.summary should get you the string.

Cheers

Bhushan

So we have a mail handler that pulls emails from exchange and creates tickets in JIRA, first step on the Create - Post Function it hits a .groovy script.

The groovy script will assign ticket priority, and then run the Summary (pulled from the title of the email) through some regex to pull info to be put to customfields, and set assignee.

At the moment atlassian-jira.log is saying it's erroring at issue.summary.toString()

0 vote
Chris Fuller Atlassian Team Sep 19, 2016

In most scripting and templating languages, such as groovy or Velocity, these are going to do the same thing. These languages aim to make your life easier by examining the classes for methods that have names like x.getFoo() and presenting them as if they were publicly accessible members x.foo. This is just syntactic sugar and has exactly the same meaning.

If you are getting an error at issue.summary.toString(), then my first wild guess would be that you're getting an NPE because issue is unexpectedly null.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

89 views 0 5
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you