Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Post function doesn't work from customer portal

Hi. I'm using Jira Misc Workflow Extensions "Scripted (Groovy) Operation on Issue Post-function" but it doesn't seem to work when executed from customer portal?

I've tested the code from editor and it worked just fine. When transition/post function is executed from Jira (not customer portal) it also works fine.

Also my post function has "Run as user:" option enabled and superadmin user is set AND is positioned lowermost in transition's post functions list.

The post function itself is a simple API call, here's the code:

import groovyx.net.http.HTTPBuilder
import groovyx.net.http.Method
import com.atlassian.jira.component.ComponentAccessor;

def cf = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Customer Request Type")
def requestType = issue.getCustomFieldValue(cf)
def path = "/rest/tts-api/latest/sla/regenerate/"
path = path + issue.key


if(requestType.toString() == "sd/b66afe4c-228d-4730-af79-d4697b4df12b"){
def remote = new HTTPBuilder("myhost.com")
def issueJson = remote.request(Method.GET) { req ->
uri.path = path
headers.'Authorization' =
"Basic ${"login:password".bytes.encodeBase64().toString()}"

response.success = { resp, json ->
json ?: [:]
}
}
}

 

How do I fix this?

4 answers

1 vote
Gökçe Gürsel {Appfire}
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Apr 07, 2020

Hi Gleb,

This is Gökçe from Snapbytes - Time to SLA support.

I see that you're trying to regenerate an SLA. Can I ask you what this script is for?

Hi Gökçe. I'm using this script to regen SLA because it does not automatically continue from pause when transitioned from customer portal.

Here are steps:

  1. Customer creates an issue from customer portal
  2. Assignee starts work on issue, SLA is running
  3. Assignee finishes their work, send issue to customer for review. SLA is set on pause
  4. Customer resolves issue, issue status is set to Done
  5. At this point SLA should be Met, but this just never happens

This is clearly a customer portal issue. I do not know why is this happening so I decided to design a lilttle sript to regen SLA. As you can see from my original question, it didn't work either.

Gökçe Gürsel {Appfire}
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Apr 08, 2020

Hi Gleb,

Can you open a support request in our customer portal so that we can investigate this? 

Customer portal 

Regards,

Gökçe

Thanks for responding! Opened ticket #1105

Hi,

is there a solution to this issue?

I have an issue that is used within jira-core and the custom portal.

Depending on a selected department in a custom field, an approver is selected and set via post function.  This works fine in jira-core but not on custom portal.

The other way around would be better.  The core user could know who the approver is, but not the external portal user.

0 votes
Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 08, 2020

Hi @Gleb Kartashov 

It is wise to track with TTS ticket, @Gökçe Gürsel {Appfire} will help you on this, however I also wanted to give some details for the users that are facing similar issues and see this post after some search via Google / Atlassian community.

Time to SLA is notified by issue events. If the transition does not fire any issue event, then your issue SLA data would not be generated.

Could you please check the post functions of that transition and make sure that it is firing an appropriate event?

0 votes
David Fischer _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 07, 2020

Hi,

did you enable error reporting for the post-function to see if you get any error? Or alternatively, did you check the Jira logs (atlassian-jira.log)?

Note that you can add some logging code in your script to know what fails. Without changing any logging setting, you can use log.error("some text") which will log the "error" in atlassian-jira.log (but don't forget to remove logging code afterwards). You can also use log.debug() but you'll have to adjust the logging level for the com.innovalog.groovy package.

Hi David. I've added a log writing of http request status and it says 200 even when transition is executed from customer portal.

I don't know now, maybe it is Jira API problem after all?

David Fischer _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 08, 2020

Yeah. If the script runs fine, I'd say it's more likely a problem with that REST API implementation. Hopefully Snapbytes will be able to help you.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events