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?
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:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gleb,
Can you open a support request in our customer portal so that we can investigate this?
Regards,
Gökçe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.