Background info: (we wish the Summary field was not required by Jira, but since it is we have to work around it somehow. Ideally, we just want the Description field with the Summary being a shortened version of the Description field.)
For our specific uses, on the Issue Create screen, we have the Summary field set to hidden. Currently, we are using the Jira Suite Utilities add-on and use it as post-function when the issue is created to copy the Description field value to the Summary field value. However, sometimes the description entered by the customer is way too long and we only want about the first 100 characters of the description field to copy to the summary, sort of as a 'preview'.
For example, if the Description entered by the customer is: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum", we need the summary to be just the first part; something like: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt..." with possibly the 3 trailing dots at the end to indicate that there is more.
Is there a way to do this? We have ScriptRunner, but have not learned how to use it yet. I have no idea what kind of script I would need to write. Any help in the right direction is much appreciated.
Thanks for the reply! We DO use the summary field, we just don't require our customer to have to enter it - we auto-generate it for them. Our reasoning for this is that in our current ticketing system, it worked this way - the user just enters their description and our queue displays a snippet of it as the "summary" when filtering through tickets (see below).
A part of the decision factor to switch to Jira SD is that we don't make our customers fill out more than they have to. To "us" the description and summary serve the same purpose.
Solution: I was able to accomplish this by setting a default value for the Summary field (i.e. just something like 'service request'), then I set the Summary field to Hidden on the customer portal. On the workflow during the Issue Create transition, using the Jira Suite Utilities add-on, I created a "Copy a parsed text to a field" post-function. I just captured the first 90 characters of the description field, added an ellipsis at the end, and overwrote the Summary field with the result. It works flawlessly.
substring(%{00001}, 0, 90) + "..."
Well, my opinionated answer is "you should use the summary field, it's there for a good reasons and most people find it useful as implemented". Humans like headlines to help them filter information quickly. That's why it's the only mandatory field!
So, let's move past the opinion and try to help:
Yes, Script Runner can help you with this. There are two routes you could take though, and it's worth deciding which one to take (so I don't have to explain both in detail!). The decision here is based on a choice about editing.
Simply - once you have created an issue (with an extracted summary), do you want the summary to continue to mirror your extract or not? Imagine you have an issue with a description of "Mr Flibble is very cross", so you extract "Mr Flibble is very cross" when it is created, do you want to change the summary when a user changes the description to "Mr Flibble has left the ship"?
If you do not want to change the summary, then you have the slightly easier route of writing a post-function on the create transition that does the extract and write.
If you do want to regenerate the summary, then you will need a listener to pick up any changes to description and regenerate it.
Either way, a couple of starting points:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I posted my reply as an Answer in case anyone else can benefit from it. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.