youngmon/atlassian-qna huggingface dataset:
How to Restrict Priorities by Request type? (ScriptRunner)
Asked by Mariam Hovhannisyan:

Dear Community,

I want to hide my priority list only for one Request type.

The following script works only for the ++issue type++ create/edit/view screen ++but not works for the Request type++ create screen in Portal.

![tempsnip2.png](/t5/image/serverpage/image-id/312036iF1DBF7B4CB0DB9D0/image-dimensions/172x145?v=v2 "tempsnip2.png")  
![tempsnip2.png](/t5/image/serverpage/image-id/312037i7AEBAB25AB666695/image-dimensions/224x62?v=v2 "tempsnip2.png")

Restriction for project and issue type I configure not in script but in Mapping:  
![tempsnip.png](/t5/image/serverpage/image-id/312035i7B7DE1AA5D83035F/image-size/large?v=v2&px=999 "tempsnip.png")

My script is here:  

***import com.atlassian.jira.component.ComponentAccessor***  
***import com.atlassian.jira.issue.fields.config.manager.PrioritySchemeManager***  
***import static com.atlassian.jira.issue.IssueFieldConstants.PRIORITY***  
***def prioritySchemeManager = ComponentAccessor.getComponent(PrioritySchemeManager)***  
***def userUtil = ComponentAccessor.getUserUtil()***  
***def currentUser = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()***  
***def allowedPriorities = prioritySchemeManager.getOptions(issueContext).findAll {***  
***it.toInteger() \< 5***  
***}***  
***getFieldById(PRIORITY).setFieldOptions(prioritySchemeManager.getPrioritiesFromIds(allowedPriorities))***  

P.S. I need to show priorities Highest - id=1, High - id=2, Medium - id=3, Low - id=4.  
Thanks in advance.  
Regards,  
Mariam


Answers:
author: Sebastian Krzewi?ski
body: Hi [@Mariam Hovhannisyan](/t5/user/viewprofilepage/user-id/4575902)

Did you set availability for request forms on portal? Based on screenshots I see that you limit it only for issue type

Regards,

Seba

comments: author: Mariam Hovhannisyan
body: Dear [@Sebastian Krzewi?ski](/t5/user/viewprofilepage/user-id/1561725) ,

Thanks a lot. I had used "Use project / issue type mapping". I have changed it "Use Service Desk mapping" and it works now.  

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/312041i912A6375829C9433/image-size/large?v=v2&px=999 "Capture.PNG")

Regards,  
Mariam


Tags: data-center

jira-service-management

jira-service-management-data-center

scriptrunner
Payload example for JSM issue
Asked by Ste404:

Hi,

I have a webhook that is getting JSM issue information from another project.  

I am trying to find where in the mass of JSON the status is located.   

When I log {{webhookData}} in the automation, it is just a mass of JSON and it is not complete so I can't copy it out to pull apart.  

Does anyone know of an example JSON payload I can look at.

Thanks.


Answers:
author: Rebekka Heilmann _viadee_
body: Hi [@Ste404](/t5/user/viewprofilepage/user-id/4984517)

check out the API documentation: [The Jira Cloud platform REST API (atlassian.com)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get)

Interestingly enough, Status doesn't seem to be part of the return value. You could simply try out the WebRequest in the Automation action though.

<br />

![Screenshot 2024-03-14 074357.png](https://community.atlassian.com/t5/image/serverpage/image-id/312020i172F280229EDEC8F/image-dimensions/219x281?v=v2 "Screenshot 2024-03-14 074357.png")

Is there a reason why you are using a WebRequest? You could use "Lookup Issues" to get any Jira issue, related or not and then access the status by {{lookupissues.first.status}}


Tags: cloud

jira-service-management

jira-service-management-cloud
Awaiting Response Automation
Asked by IT Department:

Hi,   

I am trying to work out how I can automate a reminder that notifies the reporter that we are still awaiting to hear back from them.   

I have the basics setup already but i want to add the last public comment in the reminder.

I can't seem to find any info that might help from this KBA: [Jira smart values - issues \| Cloud automation Cloud \| Atlassian Support](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/)


Answers:
author: Jack Brickey
body: Hi [@IT Department](/t5/user/viewprofilepage/user-id/5452148) , so you can't easily extract the last public comment from the rest of the comments. However, you can continually record public comments overwriting the previous recorded comment each time. You can record as issue property. Then your second rule can reference the last public comment using a smart value.

here is a post that describes the process more completely. [reference-the-last-public-service-desk-comment](https://community.atlassian.com/t5/Jira-Software-questions/How-to-reference-the-last-public-service-desk-comment-with-smart/qaq-p/972379)

comments: author: IT Department
body: Thanks.

I will have a look over this and see if it will do what I need.   

<br />


author: Jack Brickey
body: Let me know if you need further assistance. Glad to help you walk thru it.


author: IT Department
body: Hi Jack,   

I am stuck at this part

* Set Entity property
  * Select issue
  * use the key - lastCustomerComment
  * then store the comment body - {{comment.body}}

I am not sure what Set Entity Property is.   

Please note: My comprehension skill in areas i am not familiar is fairly poor.


author: Jack Brickey
body: Hi [@IT Department](/t5/user/viewprofilepage/user-id/5452148) ,

see if the following helped you resolve your request.

I created two rules for test purposes. The first rule is triggered by a comment being made on an issue. In that rule, there is a test to see if the comment is not internal, which means it's public. If it is public, then it records, the comment body into the last comment property. The second rule is just a test to see if I can send an email to the reporter which includes the recorded last public comment. Obviously you will not use Manual as the trigger in the second rule. Hopefully the images defined the details for you .

rule 1...

![IMG_3822.jpeg](https://community.atlassian.com/t5/image/serverpage/image-id/312361i9FF13A234F14A8E0/image-size/large?v=v2&px=999 "IMG_3822.jpeg")

![IMG_3823.jpeg](https://community.atlassian.com/t5/image/serverpage/image-id/312362i3D5BFEB6DC25C753/image-size/large?v=v2&px=999 "IMG_3823.jpeg")  

Rule 2...

![IMG_3824.jpeg](https://community.atlassian.com/t5/image/serverpage/image-id/312365i1C1FCEFB561568FF/image-size/large?v=v2&px=999 "IMG_3824.jpeg")


author: IT Department
body: Hi Jack,   

That looks like it did the trick.   

Thank you very much :)


author: Jack Brickey
body: Awesome! Please consider Accepting the answer.


Tags: cloud

jira-service-management

jira-service-management-cloud
Return my Jira Software subscription to the Free plan
Asked by Gustavo Gamboa:

Hi Community,

This is my first time asking here. We've noticed that Atlassian has deactivated our Jira Software subscription, and we no longer have access to the Jira Software projects also Jira Work Management projects. Please note that we were using the Free plan for Jira Software, but it seems the subscription plan was changed to Standard after the number of users exceeded the limit. I have raised a ticket with Atlassian, but I'm not sure if this is possible. We have now adjusted the number of users to not exceed the limit of the Free plan. If possible, does anyone know how long it might take to be resolved?  

Thanks.  
Gustavo


Answers:
author: John Funk
body: Hi Gustavo - Welcome to the Atlassian Community!

See this article on how to downgrade to the Free plan.

<https://community.atlassian.com/t5/Jira-Software-articles/How-to-Downgrade-Jira-Software-from-Standard-to-Free/ba-p/2045188>

comments: author: Gustavo Gamboa
body: Hi [@John Funk](/t5/user/viewprofilepage/user-id/7148)   

Thanks for sharing this article, it is very useful. In my case, the Atlassian support Team reactivated the subscription a few hours ago after submitting a request.

Thank you everyone.


author: Trudy Claspill
body: Hello [@Gustavo Gamboa](/t5/user/viewprofilepage/user-id/5452140)

Welcome to the Atlassian community.

When was your Atlassian site deactivated?

When did you raise the ticket with Atlassian support?

comments: author: Gustavo Gamboa
body: Hello [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

Thanks for the welcome!  

It was apparently deactivated yesterday EOD. We received an email from Atlassian:  

++*Action Act now to keep your access to Jira Standard*++   
++*Hello! This is the final notice that your standard Jira Software plan has ended. To keep the features of your Standard plan, you will need to add the payment details.*++

We raised the ticket from 9 hours ago today.  

Regards,


Tags: cloud

jira-service-management

jira-service-management-cloud
Request Types not displaying in Customer Portal view
Asked by Alex Carias:

We created different Request Types for different types of request and then grouped them in a Portal Group. For example, Banx Portal group has multiple Request types (image1). But in the Customer Portal, none of the Request Types display (image2). This was working until recently. I've ensured that they are "Allowing Suggestions' in the Knowledge base in the project as well as ensure they are not hidden.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/311928i221B2EF0CC07E4FF/image-size/large?v=v2&px=999 "image.png")![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/311929i85CF89DAAF7035D1/image-size/large?v=v2&px=999 "image.png")


Answers:
author: Asmath Basha S
body: Hi [@Alex Carias](/t5/user/viewprofilepage/user-id/5452070) ,

=\> Kindly check your Portal settings and Request types in your JSM Service project.

=\> Make sure that you have added the Request types in that portal.

comments: author: Alex Carias
body: They are all added to the portal as their own portal group. ![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/312127i8882B09780BA2217/image-size/large?v=v2&px=999 "image.png")


Tags: cloud

jira-service-management

jira-service-management-cloud
Jira Assets Discovery and Agents - PoC
Asked by Dvir Geva:

We are busy with a PoC of Jira Assets, particularly wanting to get the Assets Discovery and Agents to work to their full potential in order to assess the quality of the information received and its efficiency with the deduplication of records received from different sources.

Main workflow we had in mind is to use Discovery to identify devices on a regular basis, then deploy on each device the agent to get the most information from the asset captured and continuously update it. It is important that both understand that the device is the same device and they don't keep on creating duplicate asset.

Currently, we have installed the agent on a single device, but we don't seem to get to see this device anywhere on Jira Assets.

Is there a best practice configuration to get this kind of setup done?

Does Atlassian have pre-sale support that can perhaps assist with getting this PoC back on track?


Answers:
author: Davide Cioranu
body: Hi Dvir,  
I'm pretty much in the same situation myself.  
I believe this could answer your question.  
[Export data from Asset Discovery to Assets Cloud \| Jira Service Management Cloud \| Atlassian Support](https://support.atlassian.com/jira-service-management-cloud/docs/export-data-from-asset-discovery-to-asset-cloud/)

I'm trying to find out if I can automate the process and install the agent on all the devices, the process would be quite simple : Jira discovery would run as a service and run the scan once a day - then Jira Asset would import automatically the file (not entirely sure this is possible) into the system and new assets would be added.


Tags: assets

assets-discovery

cloud

jira-service-management

jira-service-management-cloud

remote-agent
How to stop Admin Notifications for a period of time?
Asked by Alicia.Peebles:

Our directory has users going back to 2015, we are looking to do a mass clean-up of the directory. When you delete an Atlassian account all Administrators will get an email that the account has been deleted and when the account is deleted (after the 14 days).

This is going to create a massive number of emails being generated. Is there any way to stop Administrators from getting notifications of deleted accounts or just to stop them for a period of time?


Answers:
author: Zoey Wang
body: Hi [@Alicia.Peebles](/t5/user/viewprofilepage/user-id/3891072)

There is no way to prevent deactivation or deletion notifications from Atlassian. This [requirement](https://jira.atlassian.com/browse/ID-7882) was raised 2 years ago but still has not been resolved yet.
> Workaround suggested: filter out the emails by

*
  > Email titles: "Your Atlassian account has been deactivated", "Your Atlassian account will be permanently deleted"
*
  > Email senders: noreply+\<letters and numbers\>@am.atlassian.com

hope that helps.

comments: author: Alicia.Peebles
body: Thank you [@Zoey Wang](/t5/user/viewprofilepage/user-id/4512393) ! I thought that was the answer and I have voted on the Atlassian ticket. :).


Tags: cloud

jira-service-management

jira-service-management-cloud
Populating an issue field with a specific Asset attribute
Asked by Robert Hook:

I have been trying to figure out a way to get an issue reporter's phone number into a custom field within the issue. I realize Atlassian doesn't store phone number in its User data, so that takes out the simple smart value route like you are able to do with {{reporter.emailAddress}}. I added users as an asset object and imported everyone from our organization into it along with their phone numbers as an object attribute. I realize this requires me to manually add/import any new hires into the Users objects, but I don't mind that piece since we are a relatively small organization.  

I cannot seem to get that specific attribute to display in an issue field though. The Users asset object is set up as shown below:  
![Jira1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/311920iE0FABAF620581F45/image-size/large?v=v2&px=999 "Jira1.jpg")

![Jira2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/311921iCBCA558587C6D42A/image-size/large?v=v2&px=999 "Jira2.jpg")  

I can point a query to the user to match the issue reporter by using  
objectType = "Users" AND "Jira User Name" = currentReporter()  

I don't know where to go from there to get to the phone number (or whether I am totally barking up the wrong tree). I tried various attempts with automation to pull in the phone number, namely by using an AQL query and then trying to reference its value with the {{lookupObjects}} smart value, but I seem to be failing at directing it to that specific attribute. Clearly I am a novice with queries and have no SQL or similar background to reference. There also may be a much easier way to accomplish what I am after, but I am the only person in our organization who has been willing to explore Jira's functionality.


Answers:
author: Fernando Eug?nio da Silva
body: [@Robert Hook](/t5/user/viewprofilepage/user-id/5452055) , Welcome to the Atlassian Community!

If you are using any Jira fields associated with Assets, you can iterate over the project using the following value:

{{issue.customfield_XXX.Attribute}}. In your case, {{issue.customfield_XXX.Office Phone}}

XXX it is related to field id created.

But if you want to do it without using an Assets field, you can get this.

In your automation that search for AQL objects, select this: ObjectType = Users AND Name IN ("{{issue.reporter.displayName}}")

This will get the object in your AQL that corresponds to the name of the user who created the issue in Jira

Then you can use the same logical object indentation feature using the following:

{{lookupObjects.Office Phone}}

It is expected that your AQL search will only bring up one object associated with the user, so the Office Phone will be from the same user retrieved in Assets. This AQL automation depends on your users' names in Jira matching the Names you assigned in Assets

Let us know if you have any questions

Kind Regards,

Fernando


Tags: cloud

jira-service-management

jira-service-management-cloud
Create and Automation based on if the issue has linked issues.
Asked by Justin Foshee:

I would like to have an automation that if a status is moved to "Escalated" then it will create a new ticket in a new project. This i got. But if it gets moved back to "In Porgress" then back to escalated, I do not want it creating a second ticket. And i can not figure out how to do this.   

![jira_auto.png](/t5/image/serverpage/image-id/311914iFFFE155AF88090BC/image-size/large?v=v2&px=999 "jira_auto.png")


Answers:
author: John Funk
body: Hi Justin - Welcome to the Atlassian Community!

In these cases, I usually create a custom field like a radio button (Yes/No - default to No) or a Checklist (Yes) and add a context for the Issue Type and/or Project. But I don't add it to a screen.

Then with your automation, add a Condition to see if the radio button = No or if Checklist if it is empty.

Then when you finish your automation, add an Edit Issue to set the custom field to Yes.

This way when the automation runs, it will only process for the first time the issue moved into the Status.


author: Justin Foshee
body: To be clear it is creating a ticket every time. I have tried the following as well.  
![jira_auto.png](https://community.atlassian.com/t5/image/serverpage/image-id/311915iC54AC5A7A21D67B7/image-size/large?v=v2&px=999 "jira_auto.png")

comments: author: Harsh
body: Hi [@Justin Foshee](/t5/user/viewprofilepage/user-id/5452039)   

There is an option in Data center automation, where it says 'Exclude issues where the automation has already ran'. If you click this is checkbox, it will not create the ticket again.  

Could you check if you have this in Cloud as well.

2nd work around will be to use if/else block and check if there is a linked issue then dont else create.

Let me know if this helps


Tags: cloud

jira-service-management

jira-service-management-cloud
Error merge API 2.0
Asked by gcordobap:

```
I get this error when I want to merge via API 2.0
```

```
{"type": "error", "error": {"message": "newstatus: Merging a pull request requires write access to the destination branch.", "fields": {"newstatus": ["Merging a pull request requires write access to the destination branch."]}}}
```

```
?
```


Answers:
author: Patrik S
body: Hello [@gcordobap](/t5/user/viewprofilepage/user-id/5159002) ,

Welcome to Atlassian Community!

Based on the error message you are receiving, the user you are using to authenticate the API call does not have ***write*** access to the destination branch (or the destination repository in case of a fork) of the pull request

This could happen if :

* The user has only **read** permissions to the repository. In this case, you would need to reach out to an Admin to update your access to **write**
* There's a [branch restriction](https://support.atlassian.com/bitbucket-cloud/docs/use-branch-permissions/) in the repository that limits the users that can write/merge to a given branch/branch pattern in pull requests. In this case, you would need to contact one of the repository or workspace admins to change that branch permission and add you to the users allowed to merge into the destination branch.

I would suggest checking the two scenarios above to confirm if any of those access settings are preventing your user to merge the pull request.

Hope that helps!

Thank you, [@gcordobap](/t5/user/viewprofilepage/user-id/5159002)

Patrik S


Tags: bitbucket-cloud

cloud
Pipeline global variables empty in echo
Asked by Justin Spalti:

I need to use the BITBUCKET_CLONE_DIR variable in my pipeline. I've tried to echo it to ensure it gets the right value, but it's coming out as empty. Keep in my mind that I'm using a self hosted windows runner for this piepline.  

I tried these variation of echo with no results. Do I have the syntax wrong?

image: atlassian/default-image:3

pipelines:  
branches:  
Pipelines-test:  
- step:  
name: 'Build MVC Secure'  
runs-on:  
- 'self.hosted'  
- 'windows'  
script:

- echo $BITBUCKET_CLONE_DIR  
- echo ${BITBUCKET_CLONE_DIR}  
- echo '${BITBUCKET_CLONE_DIR}'  
- echo "${BITBUCKET_CLONE_DIR}"  
- echo $BITBUCKET_CLONE_DIR  
- echo '$BITBUCKET_CLONE_DIR'  
- echo "$BITBUCKET_CLONE_DIR"


Answers:
author: Justin Spalti
body: I figured this out. since windows runners use powershell, I needed to write it as $env:BITBUCKET_CLONE_DIR

comments: author: Gu?ni M?r Gilbert
body: Thanks for this. Strange the official website doesn't show this... <https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/>


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
how to build maven dependencies in the in the correct version?
Asked by Andreas Schr?ck:

We have several different projects hosted on bitbucket to develop different parts of a complex framework.

These repositories have interdependencies and all of them are using maven as a build infrastructure.

Currently, we face the issue, that there is an update in one of the projects that is taken into account in another project by updating the pom.xml file.

Now I want to build the project using a pipeline build.

In our current approach, we need to check out the dependency project and build it to be able to access the artefact for the subsequent build step.

It is very nasty to update the checkout step of the pipeline yml file for each update of the pom.xml

Is there an easier way to handle these kinds of depending setups?

It would be ideal to have a pipeline/script that extracts the necessary version from the pom.xml, checks out the repository in the correct version (we use tags with the same name as the current version - e.g. pom.xml - 5.25 --\> git tag - 5.25) and builds the artefact.

We are also willing to change our current setup if this would ease our life.


Answers:
author: Patrik S
body: Hello [@Andreas Schr?ck](/t5/user/viewprofilepage/user-id/3626792) ,

Thank you for reaching out to Atlassian Community!

In this case, I would suggest using a maven plugin or XML parse that would be able to extract the version of the dependency from the pom.xml file and then you could check out the code based on that version, as you mentioned to tag the commit with the same version that is in the POM.xml file.

I did some research and found that there's a maven plugin called [Maven help plugin](http://maven.apache.org/plugins/maven-help-plugin/) that might be useful for extracting the version interactively using a maven command. This would be the command - using that plugin - to get the version from $project.version in the pom.xml :

    mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate \    -Dexpression=project.version

For more details, you can refer to the [original thread in Stack overflow.](https://stackoverflow.com/questions/3545292/how-to-get-maven-project-version-to-the-bash-command-line)

Hope that helps!

Thank you, [@Andreas Schr?ck](/t5/user/viewprofilepage/user-id/3626792) !

Patrik S


Tags: bitbucket-cloud

cloud
Does Bitbucket use my code to Build Models like Github did with ChatGpt?
Asked by Barco van Rhijn:

Github has been involved in aggregating massive amounts of data for use in ChatGpt.

While this is theoretically data open for anyone to use the original code used in training has GNU licensing in most cases.

Effectively companies like ChatGpt is using our work product and selling it. Wired puts this well in their article on the topic.

Does Atlassian do this differently? Or do Devs need to be looking at hosting our own code again?


Answers:
author: Nic Brough -Adaptavist-
body: Welcome to the Atlassian Community!

No, Bitbucket serves it up in the UI when you ask to see it. It's just a viewer.

comments: author: Barco
body: Is this in writing somewhere official by the company?


author: Nic Brough -Adaptavist-
body: Why would it need to be? The marketing and documentation all make it perfectly clear what Bitbucket does.


Tags: artificial-intelligence

bitbucket-cloud

cloud

privacy